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

Readme

Keywords

none

Package Sidebar

Install

npm i json-parser-stream

Weekly Downloads

3

Version

0.1.0

License

ISC

Last publish

Collaborators

  • nisaacson