
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
streaming-json
Advanced tools
A streamlined, user-friendly JSON streaming preprocessor, crafted in JavaScript.
Welcome to streaming-json-js, a groundbreaking library designed to revolutionize the way we handle stream JSON parsing.
In an era dominated by LLMs (Large Language Models), the ability to efficiently parse JSON streams is more critical than ever. Traditionally, JSON parsing libraries have fallen short, requiring JSON data to be fully generated before any parsing can begin. streaming-json-go challenges this limitation head-on.
Using npm, download and install the code.
$ npm install --save streaming-json
For node environment:
const streamingjson = require('streaming-json');
For webpack or similar environment:
import streamingjson from 'streaming-json';
For browser environment:
<script src="node_modules/streaming-json/dist/index.aio.js"></script>
Basically, this library is used to complete fragmented JSON, making it into syntactically correct JSON. For example:
{"a": will complete to {"a":null}
and When the JSON stream continues to output as:
{"a":[tr will complete to {"a":[true]}
Do not worry about the JSON stream stopping anywhere, such as at a comma:
{"a":[true], will complete to {"a":[true]}
Escaped characters? No problem:
{"a":[true], "b": "this is unicode \u54" will complete to {"a":[true], "b": "this is unicode "}
(After the stream outputs the complete Unicode, it will then display.)
Here’s a quick example to get you started:
// init, @NOTE: We need to assign a new lexer for each JSON stream.
lexer = new streamingjson.Lexer();
// append your JSON segment
lexer.AppendString(`{"a":`)
// complete the JSON
console.log(lexer.CompleteJSON()); // will print `{"a":null}`
// append more JSON segment
lexer.AppendString(`[tr`)
// complete the JSON again
console.log(lexer.CompleteJSON()); // will print `{"a":[true]}`
For more examples please see: examples
Note: When export and export default are not used at the same time, there is the option to
turn on legacy mode. Under legacy mode, the module system can be compatible with IE6-8. For more information on legacy mode,
please see rollup supplemental file.
Unit tests guarantee support on the following environment:
| IE | CH | FF | SF | OP | IOS | Android | Node |
|---|---|---|---|---|---|---|---|
| 11+ | 100+ | 100+ | 16+ | 100+ | 10.3+ | 4.1+ | 16+ |
Note: Compiling code depend on ES5, so you need import es5-shim to compatible with
IE6-8, here is a demo
Please see:
This project is licensed under the MIT License - see the LICENSE file for details.
FAQs
A streamlined, user-friendly JSON streaming preprocessor, crafted in JavaScript.
The npm package streaming-json receives a total of 2,351 weekly downloads. As such, streaming-json popularity was classified as popular.
We found that streaming-json demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.