first-n-stream

2.0.0 • Public • Published

first-n-stream

A passthough objectMode stream that diverts the first n entries into either another stream or a callback

npm install --save first-n-stream

API

var FirstN = require('first-n-stream');
 
var withCallback = new FirstN(5, function (err, resp) {
  // resp will be an array of the first 5 items
});
 
something.pipe(withCallback).pipe(streamThatWillGetTheRest);
 
var withStream = new FirstN(5, streamThatWillGetTheFirst5);
 
something.pipe(withStream).pipe(streamThatWillGetTheRest);

license

MIT

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 2.0.0
    2
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 2.0.0
    2
  • 1.0.1
    0
  • 1.0.0
    0

Package Sidebar

Install

npm i first-n-stream

Weekly Downloads

2

Version

2.0.0

License

MIT

Last publish

Collaborators

  • cwmma