Skip to content

michaelwittig/node-joinstreams

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status NPM version NPM dependencies

joinstreams

join (or zip) multiple readable streams on object mode together.

var joinstreams = require("joinstreams");

var stream = require("stream");
var stream1 = new stream.Readable({objectMode: true});
var stream2 = new stream.Readable({objectMode: true});

joinstreams([stream1, stream2])
  .on("data", function(data) {
    "use strict";
    console.log("data", data);
  })
  .on("end", function() {
    "use strict";
    console.log("end");
  });

stream1.push(1);
stream1.push(2);
stream1.push(3);
stream1.push(null);

stream2.push(10);
stream2.push(20);
stream2.push(30);
stream2.push(null);

will print

data [ 1, 10 ]
data [ 2, 20 ]
data [ 3, 30 ]
end

About

joins readable streams

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published