canirequire › CommonJS › stop-iteration-iterator
Is stop-iteration-iterator ESM-only? Can you require() it?
Firefox 17-26 iterators throw a StopIteration object to indicate "done". This normalizes it.
Last verified Sep 9, 2026 against stop-iteration-iterator@1.1.0. JSON
CommonJS CommonJS — require() works on every Node.js version
stop-iteration-iterator ships CommonJS only. require("stop-iteration-iterator") works everywhere. import "stop-iteration-iterator" also works because Node.js and Bun can import CommonJS from ES modules, but only the default export is guaranteed; named imports depend on Node's static analysis of the module.
Does stop-iteration-iterator@1.1.0 actually load? Runtime test results
Installed and executed on Sep 9, 2026 with require("stop-iteration-iterator") from a CommonJS file and import "stop-iteration-iterator" from an ES module.
| Runtime | require("stop-iteration-iterator") | import "stop-iteration-iterator" |
|---|---|---|
| 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 stop-iteration-iterator
ES modules (import)
import stopIterationIterator from "stop-iteration-iterator";Named imports from a CommonJS package only work when Node.js can statically detect them. If a named import fails, use the default import and destructure.
CommonJS (require)
const stopIterationIterator = require("stop-iteration-iterator");Module format by version
Derived from the type, main and exports fields of every stable release on npm (2 versions; the newest 2 shown).
| Versions | Format | First published |
|---|---|---|
| 1.0.0 – 1.1.0 | CommonJS | Jan 13, 2023 |
Frequently asked
Is stop-iteration-iterator ESM-only?
stop-iteration-iterator@1.1.0 is a CommonJS package. stop-iteration-iterator ships CommonJS only. require("stop-iteration-iterator") works everywhere. import "stop-iteration-iterator" also works because Node.js and Bun can import CommonJS from ES modules, but only the default export is guaranteed; named imports depend on Node's static analysis of the module.
Can I import stop-iteration-iterator with ES module syntax?
Yes. import stopIterationIterator from "stop-iteration-iterator" works in Node.js and Bun because they support importing CommonJS modules. Named imports work only when Node.js can statically detect the exports.
Does stop-iteration-iterator work in Bun?
Yes. import "stop-iteration-iterator" loaded successfully in Bun 1.4 on Sep 9, 2026.
Does stop-iteration-iterator ship TypeScript types?
Yes. stop-iteration-iterator bundles its own type declarations; no @types package is needed.
Links
Other commonjs packages
- debug 4.4.3CommonJS
- semver 7.8.5CommonJS
- ms 2.1.3CommonJS
- picomatch 4.0.7CommonJS
- ajv 8.20.0CommonJS
- source-map 0.8.0CommonJS
- react-is 19.2.8CommonJS
- readable-stream 4.7.0CommonJS
Similar popularity
- d3-interpolate 3.0.1ESM-only
- jest-diff 30.5.1Dual
- @tailwindcss/node 4.3.3Dual
- get-east-asian-width 1.6.0ESM-only
- data-uri-to-buffer 8.0.0ESM-only
- d3-format 3.1.2ESM-only
- reflect.getprototypeof 1.0.10CommonJS
- d3-color 3.1.0ESM-only