Skip to content

kessler/herbal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

herbal

duplicate data into several streams

npm status Travis build status Dependency status

example

npm i -S herbal

const Tee = require('herbal')

// static factories
let tee1 = Tee.create(
    fs.createWriteStream('a'), 
    fs.createWriteStream('b')
)

let tee2 = Tee.createEx(
    { highWaterMark:123 },
    fs.createWriteStream('c'), 
    fs.createWriteStream('d')
)

let tee3 = Tee.createObjectStream(s1, s3, s3)

// constructor 
let tee4 = new Tee(
    [ 
        fs.createWriteStream('e'),
        fs.createWriteStream('f')
    ],
    { highWaterMark:123 }
)

// add more streams after construction
tee.add(fs.createWriteStream('g'))
tee.add(fs.createWriteStream('h'))

license

MIT © Yaniv Kessler