什么是ejson，EJSON - Extended and Extensible JSON library from Meteor made compatible for Nodejs and Browserify
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.
- User defined types
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.
The module is released through npm:
npm install --save ejson
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:
And some utility methods:
See the meteor EJSON documentation for more detailed information.
This module is licensed under MIT. Same as Meteor.js is.