writa

1.0.0 • Public • Published

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

related art

MIT

/writa/

    Package Sidebar

    Install

    npm i writa

    Weekly Downloads

    0

    Version

    1.0.0

    License

    MIT

    Last publish

    Collaborators

    • reqshark