canirequire › Dual (CommonJS + ESM) › is-promise
Is is-promise ESM-only? Can you require() it?
Test whether an object looks like a promises-a+ promise
Last verified Sep 9, 2026 against is-promise@4.0.0. JSON
Dual (CommonJS + ESM) Dual package — both require() and import work
is-promise publishes both a CommonJS entry and a native ESM entry (ESM added in 2.2.0). require("is-promise") and import "is-promise" both work on every supported Node.js version and in Bun.
Does is-promise@4.0.0 actually load? Runtime test results
Installed and executed on Sep 9, 2026 with require("is-promise") from a CommonJS file and import "is-promise" from an ES module.
| Runtime | require("is-promise") | import "is-promise" |
|---|---|---|
| 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 is-promise
ES modules (import)
import isPromise from "is-promise";CommonJS (require)
const isPromise = require("is-promise");Module format by version
Derived from the type, main and exports fields of every stable release on npm (9 versions; the newest 9 shown).
| Versions | Format | First published |
|---|---|---|
| 3.0.0 – 4.0.0 | Dual (CommonJS + ESM) | Apr 26, 2020 |
| 2.2.2 | CommonJS | Apr 25, 2020 |
| 2.2.0 – 2.2.1 | Dual (CommonJS + ESM) | Apr 25, 2020 |
| 1.0.0 – 2.1.0 | CommonJS | Dec 23, 2012 |
Frequently asked
Is is-promise ESM-only?
is-promise@4.0.0 ships CommonJS and ESM builds. is-promise publishes both a CommonJS entry and a native ESM entry (ESM added in 2.2.0). require("is-promise") and import "is-promise" both work on every supported Node.js version and in Bun.
Can I require is-promise?
Yes. is-promise ships a CommonJS entry, so require("is-promise") works on every Node.js version, alongside the native ESM entry for import.
Does is-promise work in Bun?
Yes. import "is-promise" loaded successfully in Bun 1.4 on Sep 9, 2026.
Does is-promise ship TypeScript types?
Not bundled. Install the community types with "npm install -D @types/is-promise".
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
- jwa 2.0.1CommonJS
- human-signals 8.0.1ESM-only
- is-regex 1.2.1CommonJS
- chownr 3.0.0Dual
- xmlchars 2.2.0CommonJS
- jest-regex-util 30.5.0Dual
- safe-array-concat 1.1.4CommonJS
- clone 2.1.2CommonJS