# ejson

> EJSON - Extended and Extensible JSON library from Meteor made compatible for Nodejs and Browserify

Latest version **2.2.3** (published 2022-08-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install ejson
pnpm add ejson
yarn add ejson
bun add ejson
```

## Health

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

Positive: has types package; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.2.3 |
| Published | 2022-08-11 |
| First published | 2012-03-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/ejson) |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 65.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 89 |
| Author | Arnout Kazemier |
| Maintainers | tjholowaychuk, v1, lpinca, 3rdeden |
| Keywords | EJSON, Extended, Extensible, JSON, Meteor, ejson, primus |

## Links

- npm: https://www.npmjs.com/package/ejson
- Repository: https://github.com/primus/ejson
- Homepage: https://github.com/primus/ejson#readme
- Issues: https://github.com/primus/ejson/issues
- npm.io page: https://npm.io/package/ejson

## 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

- 2.2.3 (latest) — 2022-08-11
- 2.2.2 — 2021-09-19
- 2.2.1 — 2020-12-20
- 2.2.0 — 2019-05-09
- 2.1.2 — 2015-10-20
- 2.1.1 — 2015-08-10
- 2.1.0 — 2015-08-07
- 2.0.1 — 2015-01-04
- 2.0.0 — 2015-01-03
- 1.0.1 — 2014-07-16
- 1.0.0 — 2014-06-04
- 0.0.1 — 2012-03-22

## README

# ejson

[![Version npm](https://img.shields.io/npm/v/ejson.svg?style=flat-square)](https://www.npmjs.com/package/ejson)[![Build Status](https://img.shields.io/github/workflow/status/primus/ejson/CI/master?label=CI&style=flat-square)](https://github.com/primus/ejson/actions?query=workflow%3ACI+branch%3Amaster)[![Coverage Status](https://img.shields.io/coveralls/primus/ejson/master.svg?style=flat-square)](https://coveralls.io/r/primus/ejson?branch=master)[![IRC channel](https://img.shields.io/badge/IRC-irc.freenode.net%23primus-00a8ff.svg?style=flat-square)](https://webchat.freenode.net/?channels=primus)

`ejson` is an extension of JSON to support more types. It supports all JSON-safe
types as well as

- **Date**: It maintains a date instance instead of transforming it to a string.
- **Binary**: `Uint8Array`
- **User defined types**

The `ejson` module is port of Meteor's EJSON parser which has been made
compatible for Node.js and browsers. This way, other
[real-time libraries](https://github.com/primus/primus) can also make use of
these extensions.

## Installation

The module is released through npm:

```
npm install --save ejson
```

## Usage

The API is exactly the same as the API that Meteor provides as it uses exactly
the same code. The most important API's are:

- `EJSON.clone`
- `EJSON.parse`
- `EJSON.stringify`

And some utility methods:

- `EJSON.toJSONValue`
- `EJSON.fromJSONValue`
- `EJSON.isBinary`
- `EJSON.newBinary`
- `EJSON.equals`

See the [meteor EJSON documentation](https://docs.meteor.com/#ejson) for more
detailed information.

## License

This module is licensed under MIT. Same as Meteor.js is.

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