0.0.5 • Published 4 years ago

circular-json-stringify v0.0.5

Weekly downloads
-
License
ISC
Repository
github
Last release
4 years ago

circular-json-stringify

json and bson serializer and parser which supports circular objects

Coverage Status Build Status License: ISC WebReflection status

A super light (0.5K) and fast circular JSON and BSON serializer and parser. This package is supported on all browsers

npm i circular-json-stringify 
// ESM
import {parse, stringify} from 'circular-json-stringify';

// CJS
const {parse, stringify} = require('circular-json-stringify');

var A: any = {b: new ObjectID(), c: 1};
A.a = A;

stringify(A); // {"b":{"$oid":"5e32849068f40e424a80fe42"},"c":1,"a":{"_$":""},"_0":""}

parse('{"b":{"$oid":"5e32849068f40e424a80fe42"},"c":1,"a":{"_$":""},"_0":""}'); 
  // {b: ObjectID("5e32849068f40e424a80fe42"), c: 1, a: {b: ObjectID...}}
0.0.3

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.2

4 years ago