StreamMerge
StreamMerge pipe the given streams one by one once they are readable and preserve their content integrity.
Usage
Install the npm module:
npm install streammerge --save
Then, in your scripts:
var streammerge = ; ;
StreamMerge also accept functions returning streams, the above can be written like this, doing system calls only when piping:
var streammerge = ; ;
Object-oriented traditionnal API offers more flexibility:
var StreamMerge = ; var mergeStream = ;mergeStream;mergeStream; mergeStream;
You can also chain StreamMerge methods like that:
var StreamMerge = ; ;
You can add new streams at any moment until you call the done() method. So the created stream will not fire the end event until done() call.
API
StreamMerge([options], [stream1, stream2, ... streamN])
options
options.objectMode
Type: Boolean
Default value: false
Use if piped in streams are in object mode. In this case, the merge stream will also be in the object mode.
options.*
StreamMerge inherits of Stream.Readable, the options are passed to the parent constructor so you can use it's options too.
streamN
Type: Stream
Append streams given in argument to the merge and ends when each streams are consumed.
StreamMerge.add(stream1, [stream2, ... streamN])
Append streams given in argument to the merge.
StreamMerge.done([stream1, stream2, ... streamN])
Append streams given in argument to the merge and ends when each streams are consumed.
Stats
Contributing
Feel free to pull your code if you agree with publishing it under the MIT license.