cs

cascade-stream

A duplex stream that can lazily create child streams from a chunk and merge all outputs into one

Showing:

Popularity

Downloads/wk

2

GitHub Stars

2

Maintenance

Last Commit

7yrs ago

Contributors

0

Package

Dependencies

2

Size (min+gzip)

5.9KB

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

cascade-stream

NPM

Travis

A duplex stream that can lazily create child streams from a chunk and merge all outputs into one

example

var from = require('from2-array')
var through = require('through2')
var cascade = require('cascade-stream')

// create a stream for a single letter
function createLetterStream(letter){
    return from.obj([1,2,3].map(function(num){
        return letter + ':' + num
    }))
}

var source = from.obj(['a', 'b', 'c'])

var pipeline = cascade(function(chunk, add, next){
    add(createLetterStream(chunk))
    next()
})

var sink = through.obj(function(chunk, enc, cb){
    console.log(chunk);
    cb()
})

source.pipe(pipeline).pipe(sink)
/*

    a1
    a2
    a3
    b1
    b2
    b3
    c1
    c2
    c3
    
*/

license

MIT

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100