stream-branch

0.1.4 • Public • Published

NPM version

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

Package Sidebar

Install

npm i stream-branch

Weekly Downloads

2

Version

0.1.4

License

MIT

Last publish

Collaborators

  • gobwas