@canboat/canboatjs 2.4.2 → 2.4.3

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.
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  const { Transform } = require('stream');
4
- const SerialPort = require('serialport')
4
+ const { SerialPort } = require('serialport')
5
5
 
6
6
  if ( process.argv.length < 3 ) {
7
7
  console.error('Please specify a device')
@@ -13,10 +13,12 @@ let device = process.argv[2]
13
13
 
14
14
  let baud = process.argv.length > 3 ? Number(process.argv[3]) : 230400
15
15
 
16
- let serial = new SerialPort(device, {
16
+ let serial = new SerialPort({
17
+ path:device,
17
18
  baudRate: baud
18
19
  })
19
20
 
21
+
20
22
  const toStringTr = new Transform({
21
23
  objectMode: true,
22
24
 
package/lib/serial.js CHANGED
@@ -112,8 +112,9 @@ SerialStream.prototype.start = function () {
112
112
  }
113
113
 
114
114
  if ( !this.options.fromFile ) {
115
- const SerialPort = require('serialport')
116
- this.serial = new SerialPort(this.options.device, {
115
+ const { SerialPort } = require('serialport')
116
+ this.serial = new SerialPort({
117
+ path: this.options.device,
117
118
  baudRate: this.options.baudrate || 115200
118
119
  })
119
120
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@canboat/canboatjs",
3
- "version": "2.4.2",
3
+ "version": "2.4.3",
4
4
  "description": "Native javascript version of canboat",
5
5
  "main": "index.js",
6
6
  "scripts": {