1.1.0 • Published 8 months ago

ejson2 v1.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

EJSON 2

This library allows stringifying objects while preserving some object types on parse, like Dates, Binary and also custom types defined by the user.

This is an improved version of the original ejson library from Meteor:

  1. Cloned from the Meteor repo and converted the entire codebase to TypeScript and Vitest.
  2. Now it eliminates circular references automatically.
  3. Added base64-js for handling binary data instead of maintaing own code.
  4. Removed Meteor specific code references.

All tests have been converted to Vitest and all of them pass, including new tests added.

Roadmap

  1. Add types to the entire codebase.
  2. Performance improvements as needed.

Mongoose

If you work with Mongoose now this library automatically converts ObjectIds to strings.

Installation

yarn add ejson2

or

npm install ejson2

Usage

import { EJSON } from 'ejson2'

EJSON.parse('{}')

EJSON.stringify({})
1.1.0

8 months ago

1.0.13

1 year ago

1.0.12

1 year ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago