json-stream

New line-delimeted JSON parser with a stream interface

MIT 8 个版本
安装
npm install json-stream
yarn add json-stream
pnpm add json-stream
bun add json-stream
README

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.

版本列表
1.0.0 2014-12-18
0.2.2 2014-10-13
0.2.1 2014-05-19
0.2.0 2013-06-05
0.1.2 2012-11-24
0.1.1 2012-11-24
0.1.0 2012-09-18
0.0.0 2012-06-14