# cbor-bigdecimal

> Plugin for node-cbor to add BigDecimal and BigFloat support. Requires bignumber.js

Latest version **10.0.12** (published 2026-03-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install cbor-bigdecimal
pnpm add cbor-bigdecimal
yarn add cbor-bigdecimal
bun add cbor-bigdecimal
```

## Health

**Score 50/100 (C)** — status: stable.

Positive: no vulnerabilities; has provenance.

Warnings: low downloads; no types; no esm support.

## Facts

| | |
|---|---|
| Version | 10.0.12 |
| Published | 2026-03-04 |
| First published | 2021-08-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=20 |
| Dependencies | 0 |
| Unpacked size | 5.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 379 |
| Author | Joe Hildebrand |
| Maintainers | hildjj |
| Keywords | CBOR, BigNumber, BigDecimal, BigFloat, tag |

## Links

- npm: https://www.npmjs.com/package/cbor-bigdecimal
- Repository: https://github.com/hildjj/node-cbor
- Homepage: https://github.com/hildjj/node-cbor#readme
- Issues: https://github.com/hildjj/node-cbor/issues
- npm.io page: https://npm.io/package/cbor-bigdecimal

## Alternatives

- [random-seedable](https://npm.io/package/random-seedable.md) — 27.9K weekly downloads
- [n2words](https://npm.io/package/n2words.md) — 22.2K weekly downloads
- [@stdlib/math-base-special-factorialln](https://npm.io/package/@stdlib/math-base-special-factorialln.md) — 5.7K weekly downloads
- [@stdlib/math-base-special-abs2](https://npm.io/package/@stdlib/math-base-special-abs2.md) — 1.7K weekly downloads
- [commons-math-interpolation](https://npm.io/package/commons-math-interpolation.md) — 1.4K weekly downloads

## Recent versions

- 10.0.12 (latest) — 2026-03-04
- 10.0.11 — 2025-08-26
- 10.0.10 — 2025-08-03
- 10.0.9 — 2025-06-30
- 10.0.3 — 2024-11-06
- 10.0.2 — 2024-10-27
- 9.0.0 — 2023-05-14
- 8.1.0 — 2021-11-09
- 8.0.2 — 2021-09-29
- 8.0.0 — 2021-08-04

## README

# cbor-bignumber

This package adds support for BigDecimal and BigFloats to the [cbor](../cbor)
package, relying on [bignumber.js](https://github.com/MikeMcl/bignumber.js).

## MOVE TO CBOR2

**NOTE**

All new users and most existing users of this library should move to the
[cbor2](https://github.com/hildjj/cbor2) library.  It is where most
maintenance and support and all new features are happening.  cbor2 has
support for JavaScript bigints enabled by default.

*Only* catastrophic bugs will be fixed in this library going forward.

## Installation

```sh
npm install cbor cbor-bignumber
```

## Usage

Before trying to encode or decode:

```js
const cbor = require('cbor');
const bdec = require('cbor-bigdecimal');
bdec(cbor);
```

If you want to remove the added encoders and decoders:

```js
cbor.reset();
```

If you need to access the same BigNumber class that `cbor-bigdecimal` is (e.g.
because the class has been mangled by your compressor), it is available as
`bdec.BigNumber`.

## Supported Types

Decoding supports the following CBOR tag numbers:

| Tag | Generated Type      |
|-----|---------------------|
| 4   | bignumber           |
| 5   | bignumber           |

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