Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@eveble/ejson

Eveble7MIT2.3.0

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

EJSON, Extended, Extensible, JSON, Meteor, ejson, primus

readme

ejson

Version npmBuild StatusDependenciesCoverage StatusIRC channel

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.

changelog

Changelog

2.3.0

Features

  • Added overrideType helper method to overcome issues with Mocha in --watch mode on consuming packages (PR 2)

2.2.0

Chores

  • Added CircleCI config for version 2
  • Changed package name to @eveble/ejson

Features

  • Added getType, removeType, removeTypes, isCustomType, hasType, getTypes helper methods for Eveble framework