Skip to content
/ ejson Public

EJSON - Extended JSON from Meteor available for Node.js and the front-end in one handy neat package. Made compatible for Primus.

License

Notifications You must be signed in to change notification settings

primus/ejson

Folders and files

NameName
Last commit message
Last commit date

Latest commit

a00522d · Dec 31, 2022
Aug 11, 2022
Dec 15, 2020
May 9, 2019
May 9, 2019
Dec 15, 2020
Feb 13, 2015
Dec 31, 2022
Aug 11, 2022
Aug 11, 2022
Aug 11, 2022
May 9, 2019
May 9, 2019
Sep 19, 2021

Repository files navigation

ejson

Version npmCICoverage Status

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 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 for more detailed information.

License

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

About

EJSON - Extended JSON from Meteor available for Node.js and the front-end in one handy neat package. Made compatible for Primus.

Resources

License

Stars

Watchers

Forks

Packages

No packages published