to-string-stream
v0.1.0
Published
stringify binary data transform stream
Downloads
13
Readme
To String Stream
Tranform a binary stream into strings
Installation
npm install -S to-string-stream
Usage
Create an instance of to-string and pipe a readable stream of objects into that instance
var ToStringStream = require('to-string-stream')
// to-string is an instance of require('stream').Transform
var opts = {
highWaterMark: 2
}
var stringStream = new ToStringStream(opts) // opts is optional
var readStream = {} // a stream of buffer objects
var stringified = readStream.pipe(stringStream)
stringified.on('data', function(chunk) {
console.dir(chunk) // json string
})
stringified.on('finish', function() {
console.log('finish event called, all objects stringified')
})