Skip to content

Commit

Permalink
fix(docs): add missing parsers to properties list
Browse files Browse the repository at this point in the history
  • Loading branch information
reconbot committed Sep 7, 2017
1 parent ad8abf6 commit 3faadac
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -725,6 +725,8 @@ The default `Parsers` are [Transform streams](https://nodejs.org/api/stream.html
| ByteLength | <code>Class</code> | is a transform stream that emits data as a buffer after a specific number of bytes are received. |
| Delimiter | <code>Class</code> | is a transform stream that emits data each time a byte sequence is received. |
| Readline | <code>Class</code> | is a transform stream that emits data after a newline delimiter is received. |
| Ready | <code>Class</code> | is a transform stream that waits for a sequence of "ready" bytes before emitting a ready event and emitting data events |
| Regex | <code>Class</code> | is a transform stream that uses a regular expression to split the incoming text upon. |

**Example**
```js
Expand Down Expand Up @@ -767,7 +769,7 @@ const parser = port.pipe(new Readline({ delimiter: '\r\n' }));
parser.on('data', console.log);
```

To use the `Ready` parser provide a byte start sequence. After the bytes have been received data events are passed through.
To use the `Ready` parser provide a byte start sequence. After the bytes have been received a ready event is fired and data events are passed through.
```js
const SerialPort = require('serialport');
const Ready = SerialPort.parsers.Ready;
Expand Down
5 changes: 4 additions & 1 deletion lib/parsers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
* @property {Class} [ByteLength] is a transform stream that emits data as a buffer after a specific number of bytes are received.
* @property {Class} [Delimiter] is a transform stream that emits data each time a byte sequence is received.
* @property {Class} [Readline] is a transform stream that emits data after a newline delimiter is received.
* @property {Class} [Ready] is a transform stream that waits for a sequence of "ready" bytes before emitting a ready event and emitting data events
* @property {Class} [Regex] is a transform stream that uses a regular expression to split the incoming text upon.
* @since 5.0.0
* @example
```js
Expand Down Expand Up @@ -51,7 +54,7 @@ const parser = port.pipe(new Readline({ delimiter: '\r\n' }));
parser.on('data', console.log);
```
To use the `Ready` parser provide a byte start sequence. After the bytes have been received data events are passed through.
To use the `Ready` parser provide a byte start sequence. After the bytes have been received a ready event is fired and data events are passed through.
```js
const SerialPort = require('serialport');
const Ready = SerialPort.parsers.Ready;
Expand Down

0 comments on commit 3faadac

Please sign in to comment.