canirequire › ESM-only › del-cli
Is del-cli ESM-only? Can you require() it?
Delete files and directories - Cross-platform
Last verified Sep 9, 2026 against del-cli@7.0.0. JSON
ESM-only ESM-only since 4.0.0 — last CommonJS version is 3.0.1
del-cli dropped its CommonJS build in 4.0.0 (June 2021). The last version you can require() on every Node.js version, including 18 and older, is 3.0.1, published May 16, 2020.
require("del-cli") failed in our probe on Node.js 20+ as well. See the runtime matrix below for the exact error.
Does del-cli@7.0.0 actually load? Runtime test results
Installed and executed on Sep 9, 2026 with require("del-cli") from a CommonJS file and import "del-cli" from an ES module.
| Runtime | require("del-cli") | import "del-cli" |
|---|---|---|
| Node.js 18 | ✗ failsMODULE_NOT_FOUND | ✗ failsERR_MODULE_NOT_FOUND |
| Node.js 20 | ✗ failsMODULE_NOT_FOUND | ✗ failsERR_MODULE_NOT_FOUND |
| Node.js 22 | ✗ failsMODULE_NOT_FOUND | ✗ failsERR_MODULE_NOT_FOUND |
| Node.js 24 | ✗ failsMODULE_NOT_FOUND | ✗ failsERR_MODULE_NOT_FOUND |
| Node.js 26 | ✗ failsMODULE_NOT_FOUND | ✗ failsERR_MODULE_NOT_FOUND |
| Bun 1.4 | ✗ failserror: Cannot find package 'del-cli' from '/Users/boat/Projects/top-seo/data/probe-work/del-cli/req.cjs' | ✗ failserror: Cannot find package 'del-cli' from '/Users/boat/Projects/top-seo/data/probe-work/del-cli/imp.mjs' |
How to import del-cli
ES modules (import)
import delCli from "del-cli";CommonJS (require)
// Node.js 20.19+ / 22.12+ / newer (package has no top-level await):
const delCli = require("del-cli");
// Any Node.js version:
const delCli = await import("del-cli");
// Or pin the last CommonJS release:
// npm install del-cli@3.0.1Module format by version
Derived from the type, main and exports fields of every stable release on npm (17 versions; the newest 17 shown).
| Versions | Format | First published |
|---|---|---|
| 4.0.0 – 7.0.0 | ESM-only | Jun 15, 2021 |
| 0.1.0 – 3.0.1 | CommonJS | Dec 6, 2015 |
Frequently asked
Is del-cli ESM-only?
del-cli@7.0.0 is ESM-only. del-cli dropped its CommonJS build in 4.0.0 (June 2021). The last version you can require() on every Node.js version, including 18 and older, is 3.0.1, published May 16, 2020.
Which version of del-cli still supports CommonJS / require()?
3.0.1 is the last version of del-cli with a CommonJS build. Install it with "npm install del-cli@3.0.1". Every version from 4.0.0 on is ESM-only.
How do I use del-cli from a CommonJS file?
Use a dynamic import: const mod = await import("del-cli"). On Node.js 20.19+, 22.12+ and newer, a plain require("del-cli") also works for ESM packages that do not use top-level await. Alternatively pin del-cli@3.0.1.
Does del-cli work in Bun?
Importing del-cli failed in Bun 1.4 on Sep 9, 2026: error: Cannot find package 'del-cli' from '/Users/boat/Projects/top-seo/data/probe-work/del-cli/imp.mjs'
Does del-cli ship TypeScript types?
No. del-cli ships no type declarations and there is no @types package for it.
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
- coveralls 3.1.1CommonJS
- babel-plugin-transform-react-jsx 6.24.1CommonJS
- uglify-es 3.3.9CommonJS
- eslint-plugin-markdown 5.1.0CommonJS
- standard-version 9.5.0CommonJS
- jade 1.11.0CommonJS
- yosay 3.0.0ESM-only
- eslint-plugin-json 5.0.0CommonJS