package
Sink your streams.
npm install leadGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Tagged topics.
Estimated unpacked size across 1 packages.
4.6 kB
Includes dependencies.
Sink your streams.
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));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.
MIT
phated
blaine.bublitz@gmail.com