finds.dev

creationix/jsonparse

A streaming JSON parser written in pure JavaScript for node.js

View on GitHub

★ 368JavaScriptMITupdated Nov 2021

// the take

A streaming/SAX-style JSON parser for Node.js that emits parse events as bytes arrive, instead of requiring the whole document in memory before parsing. Useful for anyone piping large JSON through an HTTP response or file stream (think JSONStream's internals) without buffering gigabytes first.

Constant memory use regardless of payload size, which plain JSON.parse can't offer. It's a single dependency-free file, easy to vendor or audit. The test suite specifically covers the hard streaming edge cases — multi-byte UTF-8 sequences split across chunk boundaries, surrogate pairs split across chunks, big tokens spanning writes — which is exactly where naive streaming JSON parsers fall apart.

No commits since late 2021; any new Node.js/V8 string-handling edge case won't get fixed. The API is low-level token/path events, not objects — you're on your own to reassemble values, which is why most people reach for it through a wrapper like JSONStream rather than directly. No TypeScript types ship with the package. README is a single paragraph pointing to an external gist for a simpler alternative, so there's effectively no documented usage example for this version's actual API.

We read the README, the directory tree and a key source file in October 2026. Nobody pays to be listed. How we judge →

// at a glance

Stars
368
Forks
64
Language
JavaScript
License
MIT
Last commit
3 Nov 2021

// nearby

If jsonparse isn't quite it.

All repos →