New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

ejson2

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ejson2

Extended JSON Evolved

latest
Source
npmnpm
Version
1.1.0
Version published
Weekly downloads
82
90.7%
Maintainers
1
Weekly downloads
 
Created
Source

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:

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

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

Roadmap

  • Add types to the entire codebase.
  • 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({})

Keywords

ejson

FAQs

Package last updated on 15 Sep 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts