canirequire › Dual (CommonJS + ESM) › jest-regex-util
Is jest-regex-util ESM-only? Can you require() it?
Last verified Sep 9, 2026 against jest-regex-util@30.5.0. JSON
Dual (CommonJS + ESM) Dual package — both require() and import work
jest-regex-util publishes both a CommonJS entry and a native ESM entry (ESM added in 30.0.0). require("jest-regex-util") and import "jest-regex-util" both work on every supported Node.js version and in Bun.
Does jest-regex-util@30.5.0 actually load? Runtime test results
Installed and executed on Sep 9, 2026 with require("jest-regex-util") from a CommonJS file and import "jest-regex-util" from an ES module.
| Runtime | require("jest-regex-util") | import "jest-regex-util" |
|---|---|---|
| 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 jest-regex-util
ES modules (import)
import jestRegexUtil from "jest-regex-util";CommonJS (require)
const jestRegexUtil = require("jest-regex-util");Module format by version
Derived from the type, main and exports fields of every stable release on npm (43 versions; the newest 43 shown).
| Versions | Format | First published |
|---|---|---|
| 30.0.0 – 30.5.0 | Dual (CommonJS + ESM) | Jun 10, 2025 |
| 0.0.0 – 29.6.3 | CommonJS | Feb 7, 2017 |
Frequently asked
Is jest-regex-util ESM-only?
jest-regex-util@30.5.0 ships CommonJS and ESM builds. jest-regex-util publishes both a CommonJS entry and a native ESM entry (ESM added in 30.0.0). require("jest-regex-util") and import "jest-regex-util" both work on every supported Node.js version and in Bun.
Can I require jest-regex-util?
Yes. jest-regex-util ships a CommonJS entry, so require("jest-regex-util") works on every Node.js version, alongside the native ESM entry for import.
Does jest-regex-util work in Bun?
Yes. import "jest-regex-util" loaded successfully in Bun 1.4 on Sep 9, 2026.
Does jest-regex-util ship TypeScript types?
Yes. jest-regex-util 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
- is-regex 1.2.1CommonJS
- chownr 3.0.0Dual
- is-promise 4.0.0Dual
- xmlchars 2.2.0CommonJS
- safe-array-concat 1.1.4CommonJS
- clone 2.1.2CommonJS
- tsconfig-paths 4.2.0CommonJS
- tiny-invariant 1.3.3Dual