convert a node stream (classic or new) into a pull-stream
Switch branches/tags
Nothing to show
Clone or download
Latest commit 0ca63b8 Sep 26, 2016
Permalink
Failed to load latest commit information.
test abort a stream that has already ended Sep 26, 2016
.gitignore initial Mar 26, 2013
.travis.yml initial Mar 26, 2013
LICENSE initial Mar 26, 2013
README.md document cb in duplex(stream, cb?) Oct 19, 2014
index.js handle aborting a stream that has already ended Sep 26, 2016
package.json 1.7.2 Sep 26, 2016

README.md

stream-to-pull-stream

Convert a classic-stream, or a new-stream into a pull-stream

example

var toPull = require('stream-to-pull-stream')
var pull = require('pull-stream')

pull(
  toPull.source(fs.createReadStream(__filename)),
  pull.map(function (e) { return e.toString().toUpperCase() }),
  toPull.sink(process.stdout, function (err) {
    if(err) throw err
    console.log('done')
  })
)

if the node steam is a duplex (i.e. net, ws) then use toPull.duplex(stream, cb?) duplex takes an optional callback in the same way that sink does.

License

MIT