Skip to content

New line-delimeted JSON parser with a stream interface

License

Notifications You must be signed in to change notification settings

jalessandro/json-stream

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 = new 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.

About

New line-delimeted JSON parser with a stream interface

Resources

License

Stars

Watchers

Forks

Packages

No packages published