https://github.com/anzerr/json.stream
Pipe a stream of grouped JSON objects emits split parsable JSON buffers
https://github.com/anzerr/json.stream
json nodejs stream util
Last synced: 2 months ago
JSON representation
Pipe a stream of grouped JSON objects emits split parsable JSON buffers
- Host: GitHub
- URL: https://github.com/anzerr/json.stream
- Owner: anzerr
- License: mit
- Created: 2019-05-07T11:55:06.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2022-01-21T16:11:54.000Z (over 4 years ago)
- Last Synced: 2025-01-30T09:15:29.178Z (over 1 year ago)
- Topics: json, nodejs, stream, util
- Language: JavaScript
- Homepage:
- Size: 72.3 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
### `Intro`

Split a streamed json into parsable chunks.
#### `Install`
``` bash
npm install --save git+https://github.com/anzerr/json.stream.git
npm install --save @anzerr/json.stream
```
### `Example`
``` javascript
const {JsonStream, Parser} = require('json.stream');
let s = new JsonStream();
s.on('data', (chunk) => {
console.log(JSON.parse(chunk.toString()));
});
let p = new Parser();
console.log(p.push('{"cat":1}{"cat":2}{"cat":3}').process());
s.write('{"cat":1}{"cat":2}{"cat":3}');
```