A stream that emits multiple other streams one after another (streams3)
Simple, robust streams3 version of combined-stream. Allows you to combine multiple streams into a single stream. When the first stream ends, the next one starts, and so on, until all streams are consumed.
This module is used by WebTorrent, specifically create-torrent.
install
npm install multistream
usage
Use multistream
like this:
var MultiStream = var fs = var streams = fs fs fs streams // => 123
You can also create an object-mode stream with MultiStream.obj(streams)
.
To lazily create the streams, wrap them in a function:
var streams = fs { // will be executed when the stream is active return fs } { // same return fs } streams // => 123
Alternatively, streams may be created by an asynchronous "factory" function:
var count = 0 { if count > 3 return count++ } factory // => 123
contributors
license
MIT. Copyright (c) Feross Aboukhadijeh.