// equal to merge2([stream1, stream2], stream3)conststream=merge2()stream.add([stream1, stream2])stream.add(stream3)
// merge order:// 1. merge `stream1`;// 2. merge `stream2` and `stream3` in parallel after `stream1` merged;// 3. merge 'stream4' after `stream2` and `stream3` merged;conststream=merge2(stream1, [stream2, stream3], stream4)// merge order:// 1. merge `stream5` and `stream6` in parallel after `stream4` merged;// 2. merge 'stream7' after `stream5` and `stream6` merged;stream.add([stream5, stream6], stream7)
It will emit 'queueDrain' when all streams merged. If you set end === false in options, this event give you a notice that should add more streams to merge or end the mergedStream.
stream
option Type: Readable or Duplex or Transform stream.
options
option Type: Object.
end - Boolean - if end === false then mergedStream will not be auto ended, you should end by yourself. Default:undefined
pipeError - Boolean - if pipeError === true then mergedStream will emit error event from source streams. Default:undefined
objectMode - Boolean . Default:true
objectMode and other options(highWaterMark, defaultEncoding ...) is same as Node.js Stream.