writa
v1.0.0
Published
a generic node writable stream function
Downloads
7
Maintainers
Readme
writa
a generic node stream_writable
function
install
$ npm i writa
use
const writa = require('writa')
/* first obtain the source stream */
const { createReadStream } = require('fs')
const r = createReadStream('readme.markdown')
/* obtain a writable destination by passing a function to writa */
const s = writa(function (chunk, _, next) {
/* consume readable's data */
console.log(chunk+'')
/* callback moves stream forward to next chunk */
next()
})
/* pipe to it now from some source stream, like readable */
r.pipe(s)
test
npm t