canirequire › ESM-only › @vitest/coverage-c8
Is @vitest/coverage-c8 ESM-only? Can you require() it?
C8 coverage provider for Vitest
Last verified Sep 9, 2026 against @vitest/coverage-c8@0.33.0. JSON
ESM-only ESM-only — it has never shipped a CommonJS build
@vitest/coverage-c8 has been ESM-only since its first stable release. There is no version you can require() on Node.js 18 or older.
require("@vitest/coverage-c8") failed in our probe on Node.js 20+ as well. See the runtime matrix below for the exact error.
Deprecated: v8 coverage is moved to @vitest/coverage-v8 package
Does @vitest/coverage-c8@0.33.0 actually load? Runtime test results
Installed and executed on Sep 9, 2026 with require("@vitest/coverage-c8") from a CommonJS file and import "@vitest/coverage-c8" from an ES module.
| Runtime | require("@vitest/coverage-c8") | import "@vitest/coverage-c8" |
|---|---|---|
| Node.js 18 | ✗ failsERR_PACKAGE_PATH_NOT_EXPORTED | ✓ works |
| Node.js 20 | ✗ failsERR_PACKAGE_PATH_NOT_EXPORTED | ✓ works |
| Node.js 22 | ✗ failsERR_PACKAGE_PATH_NOT_EXPORTED | ✓ works |
| Node.js 24 | ✗ failsERR_PACKAGE_PATH_NOT_EXPORTED | ✓ works |
| Node.js 26 | ✗ failsERR_PACKAGE_PATH_NOT_EXPORTED | ✓ works |
| Bun 1.4 | ✗ failserror: Cannot find module '@vitest/coverage-c8' from '/Users/boat/Projects/top-seo/data/probe-work/@vitest__coverage-c8/req.cjs' | ✓ works |
How to import @vitest/coverage-c8
ES modules (import)
import coverageC8 from "@vitest/coverage-c8";CommonJS (require)
// Node.js 20.19+ / 22.12+ / newer (package has no top-level await):
const coverageC8 = require("@vitest/coverage-c8");
// Any Node.js version:
const coverageC8 = await import("@vitest/coverage-c8");Module format by version
Derived from the type, main and exports fields of every stable release on npm (56 versions; the newest 56 shown).
| Versions | Format | First published |
|---|---|---|
| 0.22.0 – 0.33.0 | ESM-only | Aug 15, 2022 |
Frequently asked
Is @vitest/coverage-c8 ESM-only?
@vitest/coverage-c8@0.33.0 is ESM-only. @vitest/coverage-c8 has been ESM-only since its first stable release. There is no version you can require() on Node.js 18 or older.
Which version of @vitest/coverage-c8 still supports CommonJS / require()?
None. @vitest/coverage-c8 has always been ESM-only. Use import, or await import("@vitest/coverage-c8") from CommonJS.
How do I use @vitest/coverage-c8 from a CommonJS file?
Use a dynamic import: const mod = await import("@vitest/coverage-c8"). On Node.js 20.19+, 22.12+ and newer, a plain require("@vitest/coverage-c8") also works for ESM packages that do not use top-level await.
Does @vitest/coverage-c8 work in Bun?
Yes. import "@vitest/coverage-c8" loaded successfully in Bun 1.4 on Sep 9, 2026.
Does @vitest/coverage-c8 ship TypeScript types?
Yes. @vitest/coverage-c8 bundles its own type declarations; no @types package is needed.
Links
Other esm-only packages
- ansi-styles 7.0.0last CJS
5.2.0 - strip-ansi 7.2.0last CJS
6.0.1 - commander 15.0.0last CJS
14.0.3 - supports-color 11.0.0last CJS
8.1.1 - chalk 6.0.0last CJS
4.1.2 - tslib 2.8.1last CJS
2.5.2 - string-width 8.2.2last CJS
4.2.3 - ansi-regex 6.3.0last CJS
5.0.1
Similar popularity
- @vue/eslint-config-standard 9.0.1ESM-only
- @storybook/addon-info 5.3.21CommonJS
- @vue/cli-plugin-unit-jest 5.0.9CommonJS
- @nomiclabs/hardhat-ethers 2.2.3CommonJS