canirequire › Dual (CommonJS + ESM) › resolve-pkg-maps
Is resolve-pkg-maps ESM-only? Can you require() it?
Resolve package.json exports & imports maps
Last verified Sep 9, 2026 against resolve-pkg-maps@1.0.0. JSON
Dual (CommonJS + ESM) Dual package — both require() and import work
resolve-pkg-maps publishes both a CommonJS entry and a native ESM entry (ESM added in 1.0.0). require("resolve-pkg-maps") and import "resolve-pkg-maps" both work on every supported Node.js version and in Bun.
Does resolve-pkg-maps@1.0.0 actually load? Runtime test results
Installed and executed on Sep 9, 2026 with require("resolve-pkg-maps") from a CommonJS file and import "resolve-pkg-maps" from an ES module.
| Runtime | require("resolve-pkg-maps") | import "resolve-pkg-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 resolve-pkg-maps
ES modules (import)
import resolvePkgMaps from "resolve-pkg-maps";CommonJS (require)
const resolvePkgMaps = require("resolve-pkg-maps");Module format by version
Derived from the type, main and exports fields of every stable release on npm (1 versions; the newest 1 shown).
| Versions | Format | First published |
|---|---|---|
| 1.0.0 | Dual (CommonJS + ESM) | Dec 14, 2022 |
Frequently asked
Is resolve-pkg-maps ESM-only?
resolve-pkg-maps@1.0.0 ships CommonJS and ESM builds. resolve-pkg-maps publishes both a CommonJS entry and a native ESM entry (ESM added in 1.0.0). require("resolve-pkg-maps") and import "resolve-pkg-maps" both work on every supported Node.js version and in Bun.
Can I require resolve-pkg-maps?
Yes. resolve-pkg-maps ships a CommonJS entry, so require("resolve-pkg-maps") works on every Node.js version, alongside the native ESM entry for import.
Does resolve-pkg-maps work in Bun?
Yes. import "resolve-pkg-maps" loaded successfully in Bun 1.4 on Sep 9, 2026.
Does resolve-pkg-maps ship TypeScript types?
Yes. resolve-pkg-maps bundles its own type declarations; no @types package is needed.
Links
Other dual (commonjs + esm) packages
- minimatch 10.2.6Dual
- brace-expansion 5.0.9Dual
- lru-cache 11.5.2Dual
- glob 13.0.6Dual
- eslint-visitor-keys 5.0.1Dual
- yallist 5.0.0Dual
- balanced-match 4.0.4Dual
- js-yaml 5.4.1Dual
Similar popularity
- strip-indent 4.1.1ESM-only
- jest-mock 30.5.1Dual
- is-symbol 1.1.1CommonJS
- event-target-shim 6.0.2Dual
- decamelize 6.0.1ESM-only
- @babel/helper-optimise-call-expression 8.0.0ESM-only
- tinybench 6.1.6ESM-only
- eastasianwidth 0.3.0CommonJS