lead
Sink your streams.
Last updated 5 years ago by phated .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install lead 
SYNC missed versions from official npm registry.

lead

NPM version Downloads Build Status Coveralls Status

Sink your streams.

Usage

var { Readable, Transform } = require('streamx');
var sink = require('lead');

// Might be used as a Transform or Writeable
var maybeThrough = new Transform({
  transform(chunk, cb) {
    // processing
    cb(null, chunk);
  },
});

Readable.from(['hello', 'world'])
  // Sink it to behave like a Writeable
  .pipe(sink(maybeThrough));

API

sink(stream)

Takes a stream to sink and returns the same stream. Sets up event listeners to infer if the stream is being used as a Transform or Writeable stream and sinks it on nextTick if necessary. If the stream is being used as a Transform stream but becomes unpiped, it will be sunk. Respects pipe, on('data') and on('readable') handlers.

License

MIT

Current Tags

  • 4.0.0                                ...           latest (2 years ago)

5 Versions

  • 4.0.0                                ...           2 years ago
  • 3.0.0                                ...           5 years ago
  • 2.0.0                                ...           5 years ago
  • 1.0.0                                ...           8 years ago
  • 0.0.0                                ...           10 years ago
Maintainers (2)
Downloads
Total 1
Today 1
This Week 1
This Month 1
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (6)
Dependents (2)

© 2010 - cnpmjs.org x YWFE | Home | YWFE