JSON River – Parse JSON incrementally as it streams in
Source
Published
TL;DR
AI GeneratedJSON River is a tool that allows for incremental parsing of JSON data as it streams in, suitable for scenarios like network requests or language models. It provides increasingly complete values as the data is received, ensuring correctness by matching JSON.parse behavior and handling invalid input gracefully. The tool maintains invariants such as preserving data types and only modifying arrays and objects in specific ways. While JSON River is small, fast, and dependency-free, it is recommended to use JSON.parse for non-streaming scenarios for better performance. Development details include installation instructions, testing, and linting processes.