$ npm install read-stream
Base class for readable streams
var from = require("read-stream")
, stream = from(["one", "two"])
stream.pipe(process.stdout)
var from = require("read-stream")
// buffer is a shared array amongst all read calls
, stream = from(function read(bytes, buffer) {
var count = buffer.count = ++buffer.count || 0
if (count < 5) {
return count.toString()
} else {
this.emit("end")
}
})
stream.pipe(process.stdout)
npm install read-stream
© 2010 - cnpmjs.org x YWFE | Home | YWFE