Merge multiple streams into one stream in sequence or parallel.
Install with npm
npm install merge2
const gulp =const merge2 =const concat =const minifyHtml =const ngtemplate =gulp
const stream =//...stream//..stream
// equal to merge2([stream1, stream2], stream3)const stream =streamstream
// merge order:// 1. merge `stream1`;// 2. merge `stream2` and `stream3` in parallel after `stream1` merged;// 3. merge 'stream4' after `stream2` and `stream3` merged;const stream =// merge order:// 1. merge `stream5` and `stream6` in parallel after `stream4` merged;// 2. merge 'stream7' after `stream5` and `stream6` merged;stream
// nest merge// equal to merge2(stream1, stream2, stream6, stream3, [stream4, stream5]);const streamA =const streamB =const stream =streamA
const merge2 =
return a duplex stream (mergedStream). streams in array will be merged in parallel.
return the mergedStream.
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.
Boolean - if
end === false then mergedStream will not be auto ended, you should end by yourself. Default:
Boolean . Default:
objectMode and other options(
defaultEncoding ...) is same as Node.js
MIT © Teambition