How to use @signalk/streams - 4 common examples

To help you get started, we’ve selected a few @signalk/streams examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github SignalK / signalk-server-node / src / interfaces / logfiles.js View on Github external
app.get('/logfiles/', function(req, res, next) {
    listLogFiles(app, (err, files) => {
      if (err) {
        console.error(err)
        res.status(500)
        res.send('Error reading logfiles list')
        return
      }
      res.json(files)
    })
  })
  app.get('/logfiles/:filename', function(req, res, next) {
github SignalK / signalk-server-node / lib / interfaces / plugins.js View on Github external
return (providerId, data) => {
      const plugin = app.pluginsMap[id]
      if (
        !_.isUndefined(plugin) &&
        pluginsLoggingEnabled &&
        plugin.enableLogging
      ) {
        if (!plugin.logger) {
          plugin.logger = getLogger(app, providerId)
        }
        plugin.logger(data)
      }
      app.handleMessage(id, data)
    }
  }
github SignalK / signalk-server-node / src / interfaces / plugins.ts View on Github external
return (providerId: string, data: any) => {
      const plugin = app.pluginsMap[id]
      if (
        !_.isUndefined(plugin) &&
        pluginsLoggingEnabled &&
        plugin.enableLogging
      ) {
        if (!plugin.logger) {
          plugin.logger = getLogger(app, providerId)
        }
        plugin.logger(data)
      }
      app.handleMessage(id, data)
    }
  }
github SignalK / signalk-server-node / src / interfaces / logfiles.js View on Github external
app.get('/logfiles/:filename', function(req, res, next) {
    const sanitizedLogfile = path
      .join(getFullLogDir(app), req.params.filename)
      .replace(/\.\./g, '')
    res.sendFile(sanitizedLogfile)
  })
}

@signalk/streams

Utilities for handling streams of Signal K data

Apache-2.0
Latest version published 3 months ago

Package Health Score

69 / 100
Full package analysis