Skip to content

Commit

Permalink
docs: Fix missing new thanks to @patrykkalinowski
Browse files Browse the repository at this point in the history
  • Loading branch information
reconbot committed Aug 1, 2017
1 parent c90ffbb commit 92c7dd4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -758,7 +758,7 @@ To use the `Readline` parser, provide a delimiter (defaults to '\n'). Data is em
const SerialPort = require('serialport');
const Readline = SerialPort.parsers.Readline;
const port = new SerialPort('/dev/tty-usbserial1');
const parser = port.pipe(Readline({ delimiter: '\r\n' }));
const parser = port.pipe(new Readline({ delimiter: '\r\n' }));
parser.on('data', console.log);
```

Expand All @@ -767,7 +767,7 @@ To use the `Ready` parser provide a byte start sequence. After the bytes have be
const SerialPort = require('serialport');
const Ready = SerialPort.parsers.Ready;
const port = new SerialPort('/dev/tty-usbserial1');
const parser = port.pipe(Ready({ data: 'READY' }));
const parser = port.pipe(new Ready({ data: 'READY' }));
parser.on('ready', () => console.log('the ready byte sequence has been received'))
parser.on('data', console.log); // all data after READY is received
```
Expand All @@ -777,7 +777,7 @@ To use the `Regex` parser provide a regular expression to split the incoming tex
const SerialPort = require('serialport');
const Regex = SerialPort.parsers.Regex;
const port = new SerialPort('/dev/tty-usbserial1');
const parser = port.pipe(Regex({ regex: /[\r\n]+/ }));
const parser = port.pipe(new Regex({ regex: /[\r\n]+/ }));
parser.on('data', console.log);
```

Expand Down
6 changes: 3 additions & 3 deletions lib/parsers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ To use the `Readline` parser, provide a delimiter (defaults to '\n'). Data is em
const SerialPort = require('serialport');
const Readline = SerialPort.parsers.Readline;
const port = new SerialPort('/dev/tty-usbserial1');
const parser = port.pipe(Readline({ delimiter: '\r\n' }));
const parser = port.pipe(new Readline({ delimiter: '\r\n' }));
parser.on('data', console.log);
```
Expand All @@ -56,7 +56,7 @@ To use the `Ready` parser provide a byte start sequence. After the bytes have be
const SerialPort = require('serialport');
const Ready = SerialPort.parsers.Ready;
const port = new SerialPort('/dev/tty-usbserial1');
const parser = port.pipe(Ready({ data: 'READY' }));
const parser = port.pipe(new Ready({ data: 'READY' }));
parser.on('ready', () => console.log('the ready byte sequence has been received'))
parser.on('data', console.log); // all data after READY is received
```
Expand All @@ -66,7 +66,7 @@ To use the `Regex` parser provide a regular expression to split the incoming tex
const SerialPort = require('serialport');
const Regex = SerialPort.parsers.Regex;
const port = new SerialPort('/dev/tty-usbserial1');
const parser = port.pipe(Regex({ regex: /[\r\n]+/ }));
const parser = port.pipe(new Regex({ regex: /[\r\n]+/ }));
parser.on('data', console.log);
```
*/
Expand Down

0 comments on commit 92c7dd4

Please sign in to comment.