1.0.1 • Published 9 years ago

parallel-multistream v1.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
9 years ago

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