stream-branch
v0.1.4
Published
Node Stream branching tool
Downloads
5
Maintainers
Readme
Node Stream multiplexing tool
Whatsup
This is a simple stream wrapper, that allows you to do the same things as multistream and others, but with ability to write in combined stream:
source
|
transform
|
/ \
/ \
/ \
transfrom1 ... transformN
\ /
\ /
\ /
|
transform
|
result
Example
var branch = require("stream-branch");
// for example, browserify.bundle()
getSomeReadableStream()
.pipe(makeCommonThings())
.pipe(branch({ objectMode: true },
[
// here list of transform streams
makeSomeTask(),
makeAnotherTask()
]
))
.pipe(gulp.dest("./dist"))
.pipe(uglify())
.pipe(rename({ extname: ".min.js" }))
.pipe(gulp.dest("./dist"));
Or
branch([
fs.CreateReadableStream("a.txt"),
fs.CreateReadableStream("b.txt"),
])
.pipe(someTask);
Install
$ npm install --save stream-branch
API
streamBranch([options: Object, ]param: List[Stream]) : stream.Duplex
License
MIT © Sergey Kamardin