You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Each stage is a building block; `stream-chain` wires them into one stream and handles the streaming and backpressure. For input straight from a file you can drop `createReadStream`in favor of the Node-only [file edges](https://github.com/uhop/stream-json/wiki/parseFile) (`parseFile()`); to write a token stream back to disk, use [stringerToFile()](https://github.com/uhop/stream-json/wiki/stringerToFile). See [Recipes](https://github.com/uhop/stream-json/wiki/Recipes) for more.
43
+
Each stage is a building block; `stream-chain` wires them into one stream and handles the streaming and backpressure. To read straight from a file you can drop `createReadStream`and use the Node-only [parseFile()](https://github.com/uhop/stream-json/wiki/parseFile); to write a stream back to disk, use [stringerToFile()](https://github.com/uhop/stream-json/wiki/stringerToFile). See [Recipes](https://github.com/uhop/stream-json/wiki/Recipes) for more.
44
44
45
45
## Installation
46
46
47
47
```bash
48
48
npm install --save stream-json
49
49
```
50
50
51
+
ESM only; the current version requires Node 22+ (also runs on Bun and Deno).
52
+
51
53
## What's in the box
52
54
53
-
- **[Parser](https://github.com/uhop/stream-json/wiki/Parser)** — the streaming JSON parser producing a SAX-like token stream (optionally packing keys, strings, and numbers). The [main module](https://github.com/uhop/stream-json/wiki/Main-module) decorates it with `emit()`.
54
-
- **Filters** — edit a token stream on the fly: [pick](https://github.com/uhop/stream-json/wiki/Pick), [replace](https://github.com/uhop/stream-json/wiki/Replace), [ignore](https://github.com/uhop/stream-json/wiki/Ignore), [filter](https://github.com/uhop/stream-json/wiki/Filter).
- **[JSONC](https://github.com/uhop/stream-json/wiki/jsonc-Parser)** ([JSON with Comments](https://jsonc.org/)) — streaming parser, stringer, and verifier, with faithful comma round-trip (`streamCommas` / `useCommas`).
59
-
- **JSONL** ([JSON Lines](https://jsonlines.org/)) — **deprecated**: now a thin re-export of [stream-chain's JSONL](https://github.com/uhop/stream-chain/wiki/jsonl), slated for removal in a future major.
60
-
- **Subpaths** — default `stream-json/...` entries attach both `.asStream` (Node `Duplex`) and `.asWebStream` (Web Streams) to every component; import from `stream-json/web/...` for browser bundles (no Node-stream code in the graph), or `stream-json/core/...` for bare factories. ESM-only, Node 22+.
55
+
- **Parsers** — [JSON](https://github.com/uhop/stream-json/wiki/Parser), [JSONL](https://github.com/uhop/stream-chain/wiki/jsonl) (the fast path for line-delimited data dumps), and [JSONC](https://github.com/uhop/stream-json/wiki/jsonc-Parser) (JSON with comments).
56
+
- **Helpers for streamed objects** — pick out the parts you want, assemble objects from tokens, output JSON back, and read or write files directly.
57
+
- **Runtimes** — works out of the box on Node (Node streams); browser-safe (Web Streams) and dependency-free Core (no streams) builds are there when you need them.
61
58
62
-
Full documentation is in the **[wiki](https://github.com/uhop/stream-json/wiki)** — browse the [index](https://github.com/uhop/stream-json/wiki/Home), or [search it](https://uhop.github.io/wiki-search/app/?wiki=uhop/stream-json) by name.
59
+
Want the details? Follow the links, or browse the **[wiki](https://github.com/uhop/stream-json/wiki)** — [index](https://github.com/uhop/stream-json/wiki/Home) or [search](https://uhop.github.io/wiki-search/app/?wiki=uhop/stream-json).
0 commit comments