parallel-multistream

v1.0.1
Parallel version of multistream

parallel-multistream

Parallel version of multistream

npm install parallel-multistream

build status

Usage

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).

License

MIT

npm i parallel-multistream

Metadata

  • MIT
  • Whatever
  • Mathias Buus
  • released 11/18/2014

Downloads