json-stream ![Build Status](https://camo.githubusercontent.com/6d11faa2b823df81d500cc214f0c0d37b46044c1ea6aa051fd01ec473ce85c33/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f6d6d616c65636b692f6a736f6e2d73747265616d2e706e673f6272616e63683d6d6173746572)
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.