{"library":"nano-json-stream-parser","title":"nano-json-stream-parser","description":"This library (`nano-json-stream-parser`) provides a lightweight, pure JavaScript streamed JSON parser, weighing approximately 750 bytes (gzipped). Currently at version 0.1.2, it aims to offer functionality similar to larger alternatives like Oboe.js, achieving an 85% size reduction in bundle size, which is critical for highly optimized web applications or environments with strict resource constraints. The parsing mechanism involves feeding chunks of a JSON string to a function, which then invokes a callback whenever a complete JSON entity (object or array) has been fully parsed. However, a significant caveat is that the project explicitly states it lacks comprehensive tests and may contain buggy edge-cases, making it potentially unsuitable for mission-critical production environments without thorough internal validation. Its development appears to be inactive, with the last commit several years ago, indicating it is not actively maintained, nor does it have a clear release cadence, suggesting it's largely abandoned. Developers should be aware of these limitations when considering its use for new projects.","language":"javascript","status":"abandoned","last_verified":"Sun Apr 19","install":{"commands":["npm install nano-json-stream-parser"],"cli":null},"imports":["const parse = require('nano-json-stream-parser');","(No named export for the main functionality)"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"const njsp = require(\"nano-json-stream-parser\");\n\n// Callback is called when there is a complete JSON\nconst parse = njsp((json) => {\n  console.log('Parsed JSON:', JSON.stringify(json));\n});\n\nconsole.log('--- Parsing [1,2,3,4] ---');\nparse('[1,2,3,4]');\n\nconsole.log('--- Parsing [1,2,3,4] in chunks ---');\nparse('[1,2');\nparse(',3,4]');\n\nconsole.log('--- Parsing object in chunks ---');\nparse('{\"pos\": {\"x\":');\nparse('1.70, \"y\": 2.');\nparse('49, \"z\": 2e3}}');\n\nconsole.log('--- Parsing string with escapes ---');\nparse('[ \"aaaa\\\"abcd\\\\u0123\\\\\\\\aa\\/aa\" ]');\n","lang":"javascript","description":"Demonstrates how to initialize the streaming JSON parser and feed it chunks of a JSON string, showing how complete JSON objects are emitted via the provided callback. It also illustrates its behavior with fragmented and escaped JSON.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}