1.2.2 • Published 4 years ago

bson-util v1.2.2

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

bson-util

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

Install

npm install bson-util

Features

  • stringifies and parses json documents
  • Observe the structural differences between two objects.
  • Supports different result structure based on different needs such as Restful APIs, or MongoDB patches.

Importing

nodejs

// ESM
import {parse, stringify} from 'bson-util';

// CJS
const {parse, stringify} = require('bson-util');

Examples

You can find more samples in main.test.ts.

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

let newA = parse(stringify(A, true), true);
// newA == A
1.2.0

4 years ago

1.1.0

4 years ago

1.2.2

4 years ago

1.2.1

4 years ago

1.0.18

5 years ago

1.0.17

5 years ago

1.0.16

5 years ago

1.0.15

5 years ago

1.0.14

5 years ago

1.0.13

5 years ago

1.0.11

5 years ago

1.0.12

5 years ago

1.0.8

5 years ago

1.0.10

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago

0.1.6

5 years ago

0.1.4

5 years ago

0.1.5

5 years ago

0.1.2

5 years ago

0.1.3

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago

0.0.1

5 years ago