canirequire

canirequireCommonJS › istanbul-lib-source-maps

Is istanbul-lib-source-maps ESM-only? Can you require() it?

Source maps support for istanbul

Last verified Sep 9, 2026 against istanbul-lib-source-maps@5.0.6. JSON

CommonJS CommonJS — require() works on every Node.js version

istanbul-lib-source-maps ships CommonJS only. require("istanbul-lib-source-maps") works everywhere. import "istanbul-lib-source-maps" also works because Node.js and Bun can import CommonJS from ES modules, but only the default export is guaranteed; named imports depend on Node's static analysis of the module.

Latest
5.0.6 (Jul 2, 2024)
Module format
CommonJS
Last CommonJS version
5.0.6
TypeScript types
@types/istanbul-lib-source-maps
Node engines
>=10
Weekly downloads
55.8M
License
BSD-3-Clause

Does istanbul-lib-source-maps@5.0.6 actually load? Runtime test results

Installed and executed on Sep 9, 2026 with require("istanbul-lib-source-maps") from a CommonJS file and import "istanbul-lib-source-maps" from an ES module.

Runtimerequire("istanbul-lib-source-maps")import "istanbul-lib-source-maps"
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 istanbul-lib-source-maps

ES modules (import)

import istanbulLibSourceMaps from "istanbul-lib-source-maps";

Named imports from a CommonJS package only work when Node.js can statically detect them. If a named import fails, use the default import and destructure.

CommonJS (require)

const istanbulLibSourceMaps = require("istanbul-lib-source-maps");

Module format by version

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

VersionsFormatFirst published
1.0.0 – 5.0.6CommonJSAug 31, 2016

Frequently asked

Is istanbul-lib-source-maps ESM-only?

istanbul-lib-source-maps@5.0.6 is a CommonJS package. istanbul-lib-source-maps ships CommonJS only. require("istanbul-lib-source-maps") works everywhere. import "istanbul-lib-source-maps" also works because Node.js and Bun can import CommonJS from ES modules, but only the default export is guaranteed; named imports depend on Node's static analysis of the module.

Can I import istanbul-lib-source-maps with ES module syntax?

Yes. import istanbulLibSourceMaps from "istanbul-lib-source-maps" works in Node.js and Bun because they support importing CommonJS modules. Named imports work only when Node.js can statically detect the exports.

Does istanbul-lib-source-maps work in Bun?

Yes. import "istanbul-lib-source-maps" loaded successfully in Bun 1.4 on Sep 9, 2026.

Does istanbul-lib-source-maps ship TypeScript types?

Not bundled. Install the community types with "npm install -D @types/istanbul-lib-source-maps".

Links

Other commonjs packages

Similar popularity