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

lead

NPM version Downloads Build Status Coveralls Status

Sink your streams.

Usage

var from = require('from2');
var through = require('through2');
var sink = require('lead');

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

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

  • 3.0.0                                ...           latest (9 months ago)

4 Versions

  • 3.0.0                                ...           9 months ago
  • 2.0.0                                ...           9 months ago
  • 1.0.0                                ...           4 years ago
  • 0.0.0                                ...           6 years ago
Maintainers (2)
Downloads
Today 2,478
This Week 13,299
This Month 29,314
Last Day 2,753
Last Week 14,017
Last Month 69,258
Dependencies (1)
Dev Dependencies (6)

Copyright 2014 - 2016 © taobao.org |