@signalk/streams 4.3.0 → 4.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/n2kAnalyzer.js +6 -2
  2. package/package.json +1 -1
package/n2kAnalyzer.js CHANGED
@@ -48,9 +48,13 @@ function N2KAnalyzer(options) {
48
48
  const that = this
49
49
  this.linereader.on('line', function (data) {
50
50
  try {
51
- parsed = JSON.parse(data)
51
+ let parsed = JSON.parse(data)
52
+ if (parsed.version) {
53
+ console.log('Connected to analyzer v' + parsed.version)
54
+ return
55
+ }
52
56
  that.push(parsed)
53
- options.app.emit(this.analyzerOutEvent, parsed)
57
+ options.app.emit(that.analyzerOutEvent, parsed)
54
58
  } catch (ex) {
55
59
  console.error(data)
56
60
  console.error(ex.stack)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@signalk/streams",
3
- "version": "4.3.0",
3
+ "version": "4.4.0",
4
4
  "description": "Utilities for handling streams of Signal K data",
5
5
  "main": "index.js",
6
6
  "scripts": {