1.2.2 • Published 3 years ago

bson-util v1.2.2

Weekly downloads
118
License
ISC
Repository
github
Last release
3 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

3 years ago

1.1.0

3 years ago

1.2.2

3 years ago

1.2.1

3 years ago

1.0.18

3 years ago

1.0.17

3 years ago

1.0.16

4 years ago

1.0.15

4 years ago

1.0.14

4 years ago

1.0.13

4 years ago

1.0.11

4 years ago

1.0.12

4 years ago

1.0.8

4 years ago

1.0.10

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago

0.1.6

4 years ago

0.1.4

4 years ago

0.1.5

4 years ago

0.1.2

4 years ago

0.1.3

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago

0.0.1

4 years ago