# json-edm-parser

> This is a JSON streaming parser for node.js. It will handle the Entity Data Model (EDM) types to be compatitable with odata.

Latest version **0.1.2** (published 2016-05-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install json-edm-parser
pnpm add json-edm-parser
yarn add json-edm-parser
bun add json-edm-parser
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.2 |
| Published | 2016-05-12 |
| First published | 2016-01-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Yang Xia |
| Maintainers | yaxia |
| Keywords | json, stream, odata, edm, parser |

## Links

- npm: https://www.npmjs.com/package/json-edm-parser
- Repository: https://github.com/yaxia/json-edm-parser
- Homepage: https://github.com/yaxia/json-edm-parser#readme
- Issues: https://github.com/yaxia/json-edm-parser/issues
- npm.io page: https://npm.io/package/json-edm-parser

## Dependencies (1)

- [jsonparse](https://npm.io/package/jsonparse.md) ~1.2.0

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 0.1.2 (latest) — 2016-05-12
- 0.1.1 — 2016-01-07
- 0.1.0 — 2016-01-07

## README

# json-edm-parser
[![Build Status](https://travis-ci.org/yaxia/json-edm-parser.svg?branch=master)](https://travis-ci.org/yaxia/json-edm-parser)

This is a JSON streaming parser for node.js. It will handle the Entity Data Model (EDM) types to be compatitable with odata.

When you use JSON to represent an odata entity, a number without a decimal point in the JSON will have Edm.Int32 by default and 
will have Edm.Double if there are non-zero digits after the decimal point. However, if the value is set to *.0, 
Most JSON parsers will take it as an integer. To keep the type information, this parser will add an additional member "<property>@odata.type": "Edm.Double" 
to the object.

## Install

```shell
npm install json-edm-parser
```

## Usage

```Javascript
var Parser = require('json-edm-parser');

var p = new Parser();
p.write('{ "doubleIntNumber": 12.00,');
p.write('"doubleNormalNumber": 1.2,');
p.write('"doubleLargeNumber": 12345678901234546789.0000000000000000000000000001,');
p.write('"int64LargeNumber": 12345678901234567890123456789}');

/*
* You will get 
*  { 'doubleIntNumber@odata.type': 'Edm.Double',
*    doubleIntNumber: '12.00',
*    doubleNormalNumber: 1.2,
*    'doubleLargeNumber@odata.type': 'Edm.Double',
*    doubleLargeNumber: '12345678901234546789.0000000000000000000000000001',
*    int64LargeNumber: '12345678901234567890123456789' }
*/
p.onValue = function (value) {
  // Deal with the value
};
```

---
_Source: https://npm.io/package/json-edm-parser · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
