json-edm-parser is a streaming JSON parser designed for Node.js environments. Its primary function is to interpret and preserve Entity Data Model (EDM) type information, making it compatible with OData specifications. Specifically, it addresses the common issue where standard JSON parsers might misinterpret numbers (e.g., `12.00` as an integer) by explicitly adding an `"<property>@odata.type": "Edm.Double"` member to objects for values that represent doubles but might otherwise be seen as integers. The package is currently at version 0.1.2 and has not seen updates in approximately nine years, indicating it is no longer actively maintained. Its release cadence was minimal, and its niche focus on OData EDM type preservation within a streaming context differentiates it from general-purpose JSON parsers.
npm install json-edm-parserVerified import paths — ran on the pinned version, not inferred.
This example demonstrates how to use the streaming parser to process a JSON string, capturing the `onValue` events and aggregating the parsed output. It highlights how the parser adds `@odata.type` properties for specific number formats to preserve OData EDM type information.
For ESM projects, use dynamic import `import('json-edm-parser')` or create a CJS wrapper module. Alternatively, ensure your build system can handle CJS modules in an ESM context.Consider using more modern and actively maintained JSON parsers, especially if OData EDM type handling is not strictly required or can be implemented with a post-processing step.
Be aware of the output format. If you need numbers in a specific format (e.g., BigInt) or prefer a pure JSON output without OData type annotations, custom post-processing will be necessary.
Create a `json-edm-parser.d.ts` file in your project or install `@types/json-edm-parser` if it ever becomes available (unlikely given abandonment). For basic usage, `declare module 'json-edm-parser';` can suppress errors, but without type safety.
If in an ESM project, use `const Parser = (await import('json-edm-parser')).Parser;` or ensure your `package.json` specifies `"type": "commonjs"` if you intend to use `require()`.Ensure `const Parser = require('json-edm-parser');` is used in a CommonJS context. If using a transpiler or bundler, verify it handles CJS modules correctly.No dependency data recorded yet.