canirequire › Dual (CommonJS + ESM) › yeoman-test
Is yeoman-test ESM-only? Can you require() it?
Test utilities for Yeoman generators
Last verified Sep 9, 2026 against yeoman-test@11.8.2. JSON
Dual (CommonJS + ESM) Dual package — both require() and import work
yeoman-test publishes both a CommonJS entry and a native ESM entry (ESM added in 7.0.0). require("yeoman-test") and import "yeoman-test" both work on every supported Node.js version and in Bun.
Does yeoman-test@11.8.2 actually load? Runtime test results
Installed and executed on Sep 9, 2026 with require("yeoman-test") from a CommonJS file and import "yeoman-test" from an ES module.
| Runtime | require("yeoman-test") | import "yeoman-test" |
|---|---|---|
| Node.js 18 | ✗ failsERR_REQUIRE_ESM | ✗ failsERR_MODULE_NOT_FOUND |
| Node.js 20 | ✗ failsERR_MODULE_NOT_FOUND | ✗ failsERR_MODULE_NOT_FOUND |
| Node.js 22 | ✗ failsERR_MODULE_NOT_FOUND | ✗ failsERR_MODULE_NOT_FOUND |
| Node.js 24 | ✗ failsERR_MODULE_NOT_FOUND | ✗ failsERR_MODULE_NOT_FOUND |
| Node.js 26 | ✗ failsERR_MODULE_NOT_FOUND | ✗ failsERR_MODULE_NOT_FOUND |
| Bun 1.4 | ✗ failserror: Cannot find module '@yeoman/adapter/testing' from '/Users/boat/Projects/top-seo/data/probe-work/yeoman-test/node_modules/yeoman-test/dist/adapter.js' | ✗ failserror: Cannot find module '@yeoman/adapter/testing' from '/Users/boat/Projects/top-seo/data/probe-work/yeoman-test/node_modules/yeoman-test/dist/adapter.js' |
A failing require() on a CommonJS package usually means the package needs a browser/DOM global, a peer dependency, or a native binary that is not available in a bare Node.js process.
How to import yeoman-test
ES modules (import)
import yeomanTest from "yeoman-test";CommonJS (require)
const yeomanTest = require("yeoman-test");Module format by version
Derived from the type, main and exports fields of every stable release on npm (68 versions; the newest 60 shown).
| Versions | Format | First published |
|---|---|---|
| 10.1.0 – 11.8.2 | Dual (CommonJS + ESM) | Mar 21, 2025 |
| 7.0.0 – 10.0.1 | ESM-only | Nov 29, 2022 |
| 1.7.1 – 6.3.0 | CommonJS | May 9, 2018 |
Frequently asked
Is yeoman-test ESM-only?
yeoman-test@11.8.2 ships CommonJS and ESM builds. yeoman-test publishes both a CommonJS entry and a native ESM entry (ESM added in 7.0.0). require("yeoman-test") and import "yeoman-test" both work on every supported Node.js version and in Bun.
Can I require yeoman-test?
Yes. yeoman-test ships a CommonJS entry, so require("yeoman-test") works on every Node.js version, alongside the native ESM entry for import.
Does yeoman-test work in Bun?
Importing yeoman-test failed in Bun 1.4 on Sep 9, 2026: error: Cannot find module '@yeoman/adapter/testing' from '/Users/boat/Projects/top-seo/data/probe-work/yeoman-test/node_modules/yeoman-test/dist/adapter.js'
Does yeoman-test ship TypeScript types?
Yes. yeoman-test 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
- grunt-contrib-connect 5.0.1CommonJS
- vinyl-buffer 1.0.1CommonJS
- rollup-plugin-node-builtins 2.1.2CommonJS
- rollup-plugin-replace 2.2.0CommonJS
- xo 4.0.0ESM-only
- gulp-watch 5.0.1CommonJS
- np 12.1.0ESM-only
- ember-data 5.9.1CommonJS