canirequire › Dual (CommonJS + ESM) › @humanwhocodes/retry
Is @humanwhocodes/retry ESM-only? Can you require() it?
A utility to retry failed async methods.
Last verified Sep 9, 2026 against @humanwhocodes/retry@0.4.3. JSON
Dual (CommonJS + ESM) Dual package — both require() and import work
@humanwhocodes/retry publishes both a CommonJS entry and a native ESM entry (ESM added in 0.1.0). require("@humanwhocodes/retry") and import "@humanwhocodes/retry" both work on every supported Node.js version and in Bun.
Does @humanwhocodes/retry@0.4.3 actually load? Runtime test results
Installed and executed on Sep 9, 2026 with require("@humanwhocodes/retry") from a CommonJS file and import "@humanwhocodes/retry" from an ES module.
| Runtime | require("@humanwhocodes/retry") | import "@humanwhocodes/retry" |
|---|---|---|
| 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 @humanwhocodes/retry
ES modules (import)
import retry from "@humanwhocodes/retry";CommonJS (require)
const retry = require("@humanwhocodes/retry");Module format by version
Derived from the type, main and exports fields of every stable release on npm (15 versions; the newest 15 shown).
| Versions | Format | First published |
|---|---|---|
| 0.1.0 – 0.4.3 | Dual (CommonJS + ESM) | Jan 17, 2024 |
Frequently asked
Is @humanwhocodes/retry ESM-only?
@humanwhocodes/retry@0.4.3 ships CommonJS and ESM builds. @humanwhocodes/retry publishes both a CommonJS entry and a native ESM entry (ESM added in 0.1.0). require("@humanwhocodes/retry") and import "@humanwhocodes/retry" both work on every supported Node.js version and in Bun.
Can I require @humanwhocodes/retry?
Yes. @humanwhocodes/retry ships a CommonJS entry, so require("@humanwhocodes/retry") works on every Node.js version, alongside the native ESM entry for import.
Does @humanwhocodes/retry work in Bun?
Yes. import "@humanwhocodes/retry" loaded successfully in Bun 1.4 on Sep 9, 2026.
Does @humanwhocodes/retry ship TypeScript types?
Yes. @humanwhocodes/retry 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
- @smithy/is-array-buffer 4.5.2CommonJS
- @typescript-eslint/types 8.70.0CommonJS
- @smithy/util-buffer-from 4.5.2CommonJS
- @radix-ui/react-context 1.2.2Dual
- @jridgewell/gen-mapping 0.3.13Dual
- @typescript-eslint/typescript-estree 8.70.0CommonJS
- @typescript-eslint/visitor-keys 8.70.0CommonJS
- @jest/schemas 30.5.0Dual