multistream alternatives and similar modules
Based on the "Streams" category.
Alternatively, view multistream alternatives based on common mentions on social networks and blogs.
-
concat-stream
writable stream that concatenates strings or data and calls a callback with the result -
scramjet
Public tracker for Scramjet Cloud Platform, a platform that bring data from many environments together. -
duplexify
Turn a writable and readable stream into a streams2 duplex stream with support for async initialization and streams1/streams2 input -
into-stream
Convert a string/promise/array/iterable/asynciterable/buffer/typedarray/arraybuffer/object into a stream -
binary-split
a fast newline (or any delimiter) splitter stream - like require('split') but specific for binary data -
through2-concurrent
Simple Node.JS stream (streams2) Transform that runs the transform functions concurrently (with a set max concurrency) -
graphicsmagick-stream
DISCONTINUED. Fast conversion/scaling of images using a pool of long lived GraphicsMagick processes.
SurveyJS - Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of multistream or a related project?
README
multistream
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 = require('multistream')
var fs = require('fs')
var streams = [
fs.createReadStream(__dirname + '/numbers/1.txt'),
fs.createReadStream(__dirname + '/numbers/2.txt'),
fs.createReadStream(__dirname + '/numbers/3.txt')
]
new MultiStream(streams).pipe(process.stdout) // => 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.createReadStream(__dirname + '/numbers/1.txt'),
function () { // will be executed when the stream is active
return fs.createReadStream(__dirname + '/numbers/2.txt')
},
function () { // same
return fs.createReadStream(__dirname + '/numbers/3.txt')
}
]
new MultiStream(streams).pipe(process.stdout) // => 123
Alternatively, streams may be created by an asynchronous "factory" function:
var count = 0
function factory (cb) {
if (count > 3) return cb(null, null)
count++
setTimeout(function () {
cb(null, fs.createReadStream(__dirname + '/numbers/' + count + '.txt'))
}, 100)
}
new MultiStream(factory).pipe(process.stdout) // => 123
contributors
license
MIT. Copyright (c) Feross Aboukhadijeh.
*Note that all licence references and agreements mentioned in the multistream README section above
are relevant to that project's source code only.