# hadron-document

> Hadron Document

Latest version **8.13.0** (published 2026-10-30) · SSPL license · 0 weekly downloads

## Install

```sh
npm install hadron-document
pnpm add hadron-document
yarn add hadron-document
bun add hadron-document
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; no vulnerabilities; has provenance; recently updated; high maintenance score; high quality score.

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 8.13.0 |
| Published | 2026-10-30 |
| First published | 2016-06-10 |
| Weekly downloads | 0 |
| License | SSPL |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 6 |
| Unpacked size | 199.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 1497 |
| Author | MongoDB Inc |
| Maintainers | satyasinha, kristina.stefano, jarjee, devtoolsbot, mongo-j, nbbeeken, dbx-node, devtools-npm-user, durran |
| Keywords | mongodb-js |

## Links

- npm: https://www.npmjs.com/package/hadron-document
- Repository: https://github.com/mongodb-js/compass
- Issues: https://jira.mongodb.org/projects/COMPASS/issues
- npm.io page: https://npm.io/package/hadron-document

## Dependencies (6)

- [bson](https://npm.io/package/bson.md) ^7.3.2
- [lodash](https://npm.io/package/lodash.md) ^4.18.1
- [mongodb](https://npm.io/package/mongodb.md) ^7.5.0
- [eventemitter3](https://npm.io/package/eventemitter3.md) ^4.0.0
- [hadron-type-checker](https://npm.io/package/hadron-type-checker.md) ^7.5.14
- [@mongodb-js/shell-bson-parser](https://npm.io/package/@mongodb-js/shell-bson-parser.md) ^2.0.0

## Alternatives

- [angular-pipes](https://npm.io/package/angular-pipes.md) — 5.6K weekly downloads
- [@ng-web-apis/midi](https://npm.io/package/@ng-web-apis/midi.md) — 2.6K weekly downloads
- [happn-3](https://npm.io/package/happn-3.md) — 1.6K weekly downloads
- [@opensip-cli/lang-go](https://npm.io/package/@opensip-cli/lang-go.md) — 1.2K weekly downloads
- [mongoose-typescript](https://npm.io/package/mongoose-typescript.md) — 85 weekly downloads

## Recent versions

- 8.13.0 (latest) — 2026-10-30
- 0.0.0-next-e20763a4901d6f8dbea880c350b1e78d14afec4a (next) — 2025-01-21
- 0.0.0-experimental-1c53312ce4905234885618d41ae95fde9c21aa18 (experimental) — 2022-09-26
- 8.12.4 — 2026-10-29
- 8.12.3 — 2026-10-06
- 8.12.2 — 2026-10-05
- 8.12.1 — 2026-09-25
- 8.12.0 — 2026-09-16
- 8.11.8 — 2026-07-15
- 8.11.7 — 2026-07-01
- 8.11.6 — 2026-06-17
- 8.11.5 — 2026-04-20
- 8.11.4 — 2026-04-17
- 8.11.3 — 2026-03-26
- 8.11.2 — 2026-03-11
- … 574 more at https://npm.io/package/hadron-document/versions

## README

# hadron-document [![][npm_img]][npm_url]

Hadron Document is a wrapper for javascript objects that represent documents
in a database intended for use with React components. It provides element
(key/value pair) level dirty tracking with the ability to add, edit, delete
and revert changes to elements directly.

## Installation

```
npm install --save hadron-document
```

## Usage

```javascript
'use strict';

const { Document } = require('hadron-document');

var object = {
  _id: 'aphex-twin',
  name: 'Aphex Twin',
  locations: ['London'],
  emails: {
    home: 'home@aphextwin.com',
    work: 'work@aphextwin.com',
  },
};

var doc = new Document(object);
```

[npm_img]: https://img.shields.io/npm/v/hadron-document.svg?style=flat-square
[npm_url]: https://www.npmjs.org/package/hadron-document

---
_Source: https://npm.io/package/hadron-document · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
