to-string-stream

0.1.0 • Public • Published

To String Stream

Tranform a binary stream into strings

NPM

Build Status Dependency Status Code Climate

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')
})

/to-string-stream/

    Package Sidebar

    Install

    npm i to-string-stream

    Weekly Downloads

    4

    Version

    0.1.0

    License

    ISC

    Last publish

    Collaborators

    • nisaacson