@sovpro/delimited-stream

A Transform stream emitting buffered data at each delimiter instance

Update to 1.0.5 to fix incomplete data emission bug
Last updated 6 years ago by sovpro .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @sovpro/delimited-stream 
SYNC missed versions from official npm registry.

Delimited Stream

A Node.js Transform stream emitting buffered data at each delimiter instance.

Build status for Node.js 8.x and newer

Constructor

The constructor requires a Buffer instance or string value representing the delimiter.

const stream = new DelimitedStream (delimiter)

Buffered data is emitted without the delimiter by default. To keep the delimiter, pass a truthy value as the second parameter.

// include delimiter in data
const stream = new DelimitedStream (delimiter, true)

Example

Instantiate a stream with a newline sequence as the delimiter.

const delimiter = Buffer.from ("\r\n")
const stream = new DelimitedStream (delimiter)
stream.on ('data', (data) => {
  const line = data.toString ('utf8')
  // do stuff
})

Current Tags

  • 1.1.0                                ...           latest (6 years ago)

7 Versions

  • 1.1.0                                ...           6 years ago
  • 1.0.5                                ...           6 years ago
  • 1.0.4 [deprecated]           ...           6 years ago
  • 1.0.3 [deprecated]           ...           6 years ago
  • 1.0.2 [deprecated]           ...           6 years ago
  • 1.0.1 [deprecated]           ...           6 years ago
  • 1.0.0 [deprecated]           ...           6 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 1
Last Month 0
Dependencies (0)
None
Dev Dependencies (2)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |