canirequire

canirequireDual (CommonJS + ESM) › big.js

Is big.js ESM-only? Can you require() it?

A small, fast, easy-to-use library for arbitrary-precision decimal arithmetic

Last verified Sep 9, 2026 against big.js@7.0.1. JSON

Dual (CommonJS + ESM) Dual package — both require() and import work

big.js publishes both a CommonJS entry and a native ESM entry (ESM added in 6.2.0). require("big.js") and import "big.js" both work on every supported Node.js version and in Bun.

Latest
7.0.1 (Apr 21, 2025)
Module format
Dual (CommonJS + ESM)
Last CommonJS version
7.0.1
Native ESM since
6.2.0
TypeScript types
@types/big.js
Node engines
*
Weekly downloads
30.5M
License
MIT

Does big.js@7.0.1 actually load? Runtime test results

Installed and executed on Sep 9, 2026 with require("big.js") from a CommonJS file and import "big.js" from an ES module.

Runtimerequire("big.js")import "big.js"
Node.js 18✓ works✓ works
Node.js 20✓ works✓ works
Node.js 22✓ works✓ works
Node.js 24✓ works✓ works
Node.js 26✓ works✓ works
Bun 1.4✓ works✓ works

How to import big.js

ES modules (import)

import bigJs from "big.js";

CommonJS (require)

const bigJs = require("big.js");

Module format by version

Derived from the type, main and exports fields of every stable release on npm (36 versions; the newest 36 shown).

VersionsFormatFirst published
6.2.0 – 7.0.1Dual (CommonJS + ESM)Jun 4, 2022
2.0.0 – 6.1.1CommonJSMay 13, 2013

Frequently asked

Is big.js ESM-only?

big.js@7.0.1 ships CommonJS and ESM builds. big.js publishes both a CommonJS entry and a native ESM entry (ESM added in 6.2.0). require("big.js") and import "big.js" both work on every supported Node.js version and in Bun.

Can I require big.js?

Yes. big.js ships a CommonJS entry, so require("big.js") works on every Node.js version, alongside the native ESM entry for import.

Does big.js work in Bun?

Yes. import "big.js" loaded successfully in Bun 1.4 on Sep 9, 2026.

Does big.js ship TypeScript types?

Not bundled. Install the community types with "npm install -D @types/big.js".

Links

Other dual (commonjs + esm) packages

Similar popularity