$ npm install parallel-multistreamParallel version of multistream
npm install parallel-multistream
var parallel = require('parallel-multistream')
var stream = parallel([stream1, stream2, stream3])
stream.on('data', function(data) {
// 1st: data will be from stream1
// 2nd: data will be from stream2
// 3rd: data will be from stream3
// 4th: data will be from stream1
// ...
})
stream.on('end', function() {
// all streams have ended
})
Use stream.destroy() to all sub-streams and emit close.
If you want to add an additional stream you can call stream.add(substream).
MIT