canirequire

canirequireDual (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.

Latest
0.4.3 (May 7, 2025)
Module format
Dual (CommonJS + ESM)
Last CommonJS version
0.4.3
Native ESM since
0.1.0
TypeScript types
Bundled
Node engines
>=18.18
License
Apache-2.0

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.

Runtimerequire("@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).

VersionsFormatFirst published
0.1.0 – 0.4.3Dual (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

Similar popularity