Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

    first-n-streampublic

    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

    install

    npm i first-n-stream

    Downloadslast 7 days

    22

    version

    2.0.0

    license

    MIT

    repository

    github.com

    last publish

    collaborators

    • avatar