This transform stream will switch from one queued input stream to the next to provide a continuous output stream. The output stream will only end once a maximum output byte length has been reached or when explicitly ended. This allows for input streams to be queued after this stream has been piped, after output has started or even after all the previously queued up streams have completed.
npm install queued-stream
var QueuedStream = ;var fs = ;var queuedStream = maxBytes: 20000 ;queuedStream;// Add input streams when readycombinedStream// Add more input streams later;
To end after all items in the queue had been processed, just append an empty value to the queued stream.
Should read from this stream next. It will switch to the next stream in the queue after expectedBytes have been read, or if this stream has ended.
If stream is
null, output will end.
Immediately unpipes from active stream, where active, and ends the output stream.