canirequire

canirequireESM-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.

Latest
7.0.0 (Sep 18, 2025)
Module format
ESM-only
Last CommonJS version
3.0.1
ESM-only since
4.0.0 (Jun 15, 2021)
TypeScript types
None
Node engines
>=18
Weekly downloads
600K
License
MIT

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.

Runtimerequire("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.1

Module format by version

Derived from the type, main and exports fields of every stable release on npm (17 versions; the newest 17 shown).

VersionsFormatFirst published
4.0.0 – 7.0.0ESM-onlyJun 15, 2021
0.1.0 – 3.0.1CommonJSDec 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

Similar popularity