bson
npmv7.3.2TypeScriptA 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.
Runtime packages this one declares itself.
Distinct packages in the full runtime tree, deduplicated the way a package manager would.
Unpacked size of this package plus its entire runtime tree.
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.
| Package | Weekly downloads | Dependents | License | Last release |
|---|---|---|---|---|
| bsonthis page | 0 | 3 | Apache-2.0 | 29 days ago |
| commander | 451.1M | 11 | MIT | 1 day ago |
| postcss | 249.3M | 7 | MIT | 1 day ago |
| yargs-parser | 178.8M | 2 | ISC | 1 day ago |
| yaml | 176.1M | 6 | ISC | 1 day ago |
| esprima | 77.6M | 5 | BSD-2-Clause | 1 day ago |
Dependencies
Declared by bson v7.3.2. Runtime dependencies are installed with the package; dev dependencies are not.
Dev (34)
Used by
Popular packages that depend on bson.
Relationship graph
Dependencies (left) and dependents (right) of bson.
Frequently installed together
Prettier is an opinionated code formatter
TypeScript definitions for node
An AST-based pattern checker for JavaScript.
Fully featured SOCKS proxy client supporting SOCKSv4, SOCKSv4a, and SOCKSv5. Includes Bind and Associate functionality.
TypeScript execution environment and REPL for node.js, with source map support
A collection of credential providers, without requiring service clients like STS, Cognito
Official client encryption module for the MongoDB Node.js driver
Fastest Snappy compression library in Node.js
The semantic version parser used by npm.
BDD/TDD assertion library for node.js and the browser. Test framework agnostic.
Fixes stack traces for files with source maps
[](https://github.com/mongodb-js/zstd/actions/workflows/test.yml)
Release history
20 releases in the last two years, typically about 12 days apart.
| Version | Published | Size | License |
|---|---|---|---|
| 7.3.2latest | 29 days ago | 2.1 MB | Apache-2.0 |
| 7.3.1 | 2 months ago | 2.1 MB | Apache-2.0 |
| 7.3.0 | 2 months ago | 2.1 MB | Apache-2.0 |
| 7.2.0 | 7 months ago | 2.1 MB | Apache-2.0 |
| 7.1.1 | 7 months ago | 2.1 MB | Apache-2.0 |
| 7.1.0 | 7 months ago | 2.1 MB | Apache-2.0 |
| 7.0.0 | 10 months ago | 2.0 MB | Apache-2.0 |
| 7.0.0-alpha.2 | 10 months ago | 2.0 MB | Apache-2.0 |
| 7.0.0-alpha.1 | 10 months ago | 2.0 MB | Apache-2.0 |
| 7.0.0-alpha | 10 months ago | 2.0 MB | Apache-2.0 |
| 6.10.4 | 1 year ago | 2.6 MB | Apache-2.0 |
| 6.9.1 | 1 year ago | 2.3 MB | Apache-2.0 |
| 6.8.1 | 1 year ago | 2.3 MB | Apache-2.0 |
| 6.7.1 | 1 year ago | 2.3 MB | Apache-2.0 |
| 6.6.1 | 1 year ago | 2.2 MB | Apache-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.
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.