New line-delimeted JSON parser with a stream interface
JavaScript
Latest commit 08a3308 Jun 16, 2015 @jcrugzz jcrugzz Merge pull request #8 from tomekwi/patch-1
Display master build status
Permalink
Failed to load latest commit information.
lib [api] add ability to queue parsing in cases where you want it to be t… Dec 18, 2014
test
.gitignore
.travis.yml Fix `.travis.yml` Oct 13, 2014
LICENSE
README.md
package.json [dist] Version bump. 1.0.0 Dec 18, 2014

README.md

json-stream Build Status

New line-delimeted JSON parser with a stream interface.

Installation

npm install json-stream

Usage

var JSONStream = require('json-stream');

var stream = JSONStream();

stream.on('data', function (chunk) {
  console.dir(chunk);
});
stream.write('{"a":');
stream.write('42}\n');
stream.write('{"hel');
stream.write('lo": "world"}\n');

Will output:

{ a: 42 }
{ hello: 'world' }

If invalid JSON gets written, it's silently ignored.