</>PackageGraphPackageGraph

bson

npmv7.3.2TypeScript

A bson parser for node.js and the browser

Safe to adopt

Yes — bson scores well across adoption, maintenance, weight, supply chain, and licensing. No download data reported for this package yet. Last published 29 days ago. 22 releases in the last 2 years.

  • ?Adoption: grade ?, Not reported by this registry.

    No download data reported for this package yet.

  • AMaintenance: grade A, Excellent.

    Last published 29 days ago. 22 releases in the last 2 years.

  • AWeight: grade A, Excellent.

    Zero runtime dependencies, about 2.1 MB installed.

  • ASupply chain: grade A, Excellent.

    No install scripts, 2 maintainers, and a contained dependency surface.

  • ALicense: grade A, Excellent.

    Apache-2.0 — permissive, with no copyleft found in the dependency tree.

Grades are computed deterministically from registry metadata collected by PackageGraph — downloads, dependents, publish dates, the resolved dependency tree, maintainer count, and declared licenses. No third-party scores are used.

Install cost

What you actually take on by adding bson to a project.

0
Direct dependencies

Runtime packages this one declares itself.

0
Total installed

Distinct packages in the full runtime tree, deduplicated the way a package manager would.

2.1 MB
Install size

Unpacked size of this package plus its entire runtime tree.

Tree depth

Longest resolved dependency chain below this package.

Compatibility

Node.js
node >=20.19.0
Module format
ESM + CommonJS
TypeScript
Types included
Install scripts
None

Quick start

A usage example from the bson README.

import { BSON, EJSON, ObjectId } from 'bson';
// or:
// const { BSON, EJSON, ObjectId } = require('bson');

const bytes = BSON.serialize({ _id: new ObjectId() });
console.log(bytes);
const doc = BSON.deserialize(bytes);
console.log(EJSON.stringify(doc));
// {"_id":{"$oid":"..."}}

bson vs the alternatives

Packages solving a similar problem in the npm ecosystem, compared on the signals that drive an adoption decision.

PackageWeekly downloadsDependentsLicenseLast release
bsonthis page03Apache-2.029 days ago
commander451.1M11MIT1 day ago
postcss249.3M7MIT1 day ago
yargs-parser178.8M2ISC1 day ago
yaml176.1M6ISC1 day ago
esprima77.6M5BSD-2-Clause1 day ago

Dependencies

Declared by bson v7.3.2. Runtime dependencies are installed with the package; dev dependencies are not.

Dev (34)

@istanbuljs/nyc-config-typescript ^1.0.2@microsoft/api-extractor ^7.52.5@rollup/plugin-node-resolve ^16.0.1@rollup/plugin-typescript ^12.1.2@types/chai ^4.3.17@types/mocha ^10.0.7@types/node ^24.2.1@types/sinon ^21.0.0@types/sinon-chai ^3.2.12@typescript-eslint/eslint-plugin ^8.31.1@typescript-eslint/parser ^8.31.1benchmark ^2.1.4chai ^4.4.1chalk ^5.3.0dbx-js-tools github:mongodb-js/dbx-js-tools#maineslint ^9.33.0eslint-config-prettier ^10.1.2eslint-plugin-prettier ^5.2.6eslint-plugin-tsdoc ^0.5.2magic-string ^0.30.11mocha ^11.7.1node-fetch ^3.3.2nyc ^17.1.0prettier ^3.5.3rollup ^4.40.1sinon ^21.0.0sinon-chai ^3.7.0source-map-support ^0.5.21tar ^7.4.3ts-node ^10.9.2tsd ^0.33.0typescript ^5.8.3typescript-cached-transpile 0.0.6uuid ^13.0.0

Used by

Popular packages that depend on bson.

Relationship graph

Dependencies (left) and dependents (right) of bson.

mongodb-client-en…siftmongodbbson
bson dependencies dependents

Frequently installed together

Release history

20 releases in the last two years, typically about 12 days apart.

Recent versions of bson
VersionPublishedSizeLicense
7.3.2latest29 days ago2.1 MBApache-2.0
7.3.12 months ago2.1 MBApache-2.0
7.3.02 months ago2.1 MBApache-2.0
7.2.07 months ago2.1 MBApache-2.0
7.1.17 months ago2.1 MBApache-2.0
7.1.07 months ago2.1 MBApache-2.0
7.0.010 months ago2.0 MBApache-2.0
7.0.0-alpha.210 months ago2.0 MBApache-2.0
7.0.0-alpha.110 months ago2.0 MBApache-2.0
7.0.0-alpha10 months ago2.0 MBApache-2.0
6.10.41 year ago2.6 MBApache-2.0
6.9.11 year ago2.3 MBApache-2.0
6.8.11 year ago2.3 MBApache-2.0
6.7.11 year ago2.3 MBApache-2.0
6.6.11 year ago2.2 MBApache-2.0

Overview

bson is an npm package that a bson parser for node.js and the browser. It has 3 known dependents in the graph. The latest version is 7.3.2, released under the Apache-2.0 license.

Who should use it

Teams working in the npm ecosystem who need a bson parser for node.js and the browser and value a focused solution.

When not to use it

Consider an alternative if you need to minimize your dependency tree, or if a more actively-maintained option better fits your npm stack.

Pros

  • Ships TypeScript type definitions.
  • Clear open-source license (Apache-2.0).

Cons

  • Large dependency tree (34 direct dependencies) increases install size and audit surface.

Auto-generated from collected registry metadata. No external claims are inferred.

Maintainers

Keywords

Frequently asked questions

Should I use bson?

Yes — bson scores well across adoption, maintenance, weight, supply chain, and licensing. No download data reported for this package yet. Last published 29 days ago. 22 releases in the last 2 years.

How do I install bson?

Run `npm install bson` to add bson to your npm project.

What license is bson released under?

bson is distributed under the Apache-2.0 license.

How popular is bson?

npm does not publish download counts. Within PackageGraph's crawl, 3 known packages depend on bson.

Is bson still maintained?

The most recent release of bson (v7.3.2) was published 29 days ago.

Does bson run install scripts?

No. bson does not define preinstall, install, or postinstall scripts, so installing it does not execute publisher-supplied code.