json-parser-stream

0.1.0 • Public • Published

JSON Parser Stream

Parse a readable stream of json strings into javascript objects

NPM

Build Status Dependency Status Code Climate

Installation

npm install -S json-parser-stream

Usage

Create an instance of linestream and pipe a readable stream into that instance

var JSONParserStream = require('json-parser-stream')
// parser is an instance of require('stream').Transform
var opts = {
  highWaterMark: 2
}
var parser = new JSONParserStream(opts) // opts is optional
 
var readStream = {} // a stream of single json strings per data event
var parser = readStream.pipe(splitter)
parser.on('data', function(chunk) {
  console.dir(chunk)  // no line breaks here :)
})
parser.on('finish', function() {
  console.log('finish event called, all json items read')
})

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.1.0
    2
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.1.0
    2
  • 0.0.7
    1
  • 0.0.6
    1

Package Sidebar

Install

npm i json-parser-stream

Weekly Downloads

4

Version

0.1.0

License

ISC

Last publish

Collaborators

  • nisaacson