json-stream
DefinitelyTyped icon, indicating that this package has TypeScript declarations provided by the separate @types/json-stream package

1.0.0 • Public • Published

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.

/json-stream/

    Package Sidebar

    Install

    npm i json-stream

    Weekly Downloads

    200,928

    Version

    1.0.0

    License

    MIT

    Last publish

    Collaborators

    • ceejbot
    • jcrugzz
    • mmalecki