del

Delete files and directories using glob patterns, with a safe promise-based API.

Library
npm
v8.0.1
1,344stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
51/100Fair
Development Activity32
Maintenance24
Community60
Maturity60
Momentum28

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
73/100Good
Architecture70
Code Quality85
Innovation50
Learning Curve85

del is a small, focused Node.js library for deleting files and directories using glob patterns. It wraps globby for pattern matching and Node’s native fs.rm under the hood, exposing both a promise-based deleteAsync and a synchronous deleteSync API, each returning the list of paths actually removed.

Unlike a bare rm -rf or rimraf call, del builds in safety checks by default: it refuses to delete the current working directory or anything outside it unless you explicitly pass force: true. It also supports a dryRun mode for previewing what would be deleted, a per-file onProgress callback for reporting deletion progress, and a concurrency option for tuning how many deletions run in parallel.

What You Get

  • deleteAsync and deleteSync functions that return the actual list of deleted paths
  • Built-in safety checks that block deleting the cwd or paths outside it unless force is set
  • dryRun mode to preview exactly what a pattern would delete before running it
  • An onProgress callback reporting totalCount/deletedCount/percent as files are removed
  • A concurrency option to control how many deletions run in parallel

Common Use Cases

  • Clearing a dist/ or build/ output directory before a fresh build step
  • Cleaning up temporary files created during a test run or CI job
  • Removing generated cache or coverage folders as part of a clean script
  • Pruning old log or temp files matched by a glob pattern on a schedule

Under The Hood

Architecture The entire package is one flat ES module (index.js) exporting deleteAsync and deleteSync, both built on two small shared helpers: normalizePatterns (Windows path handling via slash and is-glob) and safeCheck (guards against deleting the cwd or paths outside it via is-path-cwd and is-path-inside, throwing a PresentableError). There is no class hierarchy or plugin system — the async path resolves patterns through globby then maps deletions concurrently with p-map, while the sync path mirrors the same logic with globbySync and fs.rmSync. Deleted paths are sorted for deterministic output. It’s a deliberately thin, single-responsibility module rather than a layered system, so there’s little architectural surface to break.

Tech Stack Targets Node.js >=18 and ships as pure ESM (“type”: “module”) with a dual types/default export map and sideEffects:false for tree-shaking. Runtime dependencies are all small sindresorhus utilities: globby (pattern matching), is-glob, is-path-cwd, is-path-inside, p-map (concurrency-limited mapping), slash (path normalization), and presentable-error for user-facing error messages. Dev tooling is xo (a strict opinionated ESLint config) for linting, ava for tests, tsd for type-level testing, and tempy for isolated temp directories in tests.

Code Quality test.js contains an extensive AVA suite covering both the async and sync APIs in parallel: default behavior, dot-file matching, dry-run output, progress callbacks, absolute vs relative paths outside cwd, Windows-style backslash paths, and a dedicated regression test for an EINVAL race condition run 200 times. Type correctness is checked separately via tsd against index.test-d.ts. CI (.github/workflows/main.yml) runs the full suite across Node 18/20/22 on Ubuntu, macOS, and Windows, and the xo linter is part of the npm test script itself, so nothing merges without passing lint, tests, and type checks.

What Makes It Unique del isn’t trying to out-feature rimraf — its distinguishing choice is defaulting to safety: any attempt to delete the current working directory or a path outside it throws immediately unless the caller opts in with force: true, which prevents an entire class of “deleted my whole project” accidents that plain rm -rf/rimraf usage is prone to. Combined with dryRun and onProgress, it’s built for tooling authors who need predictable, inspectable deletion rather than raw speed.

Used by 6 apps in this directory

Python
50%
Other

Airbyte

Developer Tools · Data Engineering

21,998

Open-source ELT platform with 600+ connectors for moving data from any source to warehouses, lakes, and AI agents.

View details
95
Repo Health
80
Technical
66
Dependency
Built with
Python50%
Kotlin41%
Updated today
TypeScript
90%
Other

browserless

Developer Tools · Automation

13,666

Run headless Chrome, Firefox, and WebKit as a managed Docker service — drop-in Puppeteer and Playwright support with no infrastructure overhead.

View details
84
Repo Health
82
Technical
73
Dependency
Built with
TypeScript90%
Updated 2 days ago
C++
51%
Other

Cocos Engine

Developer Tools · Game Development · Design Tools

9,798

Open-source, cross-platform 2D/3D game engine with Vulkan, Metal, and WebGL support for web, mobile, and instant gaming platforms

View details
87
Repo Health
79
Technical
71
Dependency
Built with
C++51%
TypeScript35%
Updated 3 days ago
TypeScript
98%
Other

Kibana

Analytics · Monitoring

21,284

Your open source window into the Elastic Stack — query, visualize, and act on data stored in Elasticsearch with real-time dashboards, AI-assisted search, and automated alerting.

View details
98
Repo Health
87
Technical
66
Dependency
Built with
TypeScript98%
Updated yesterday
TypeScript
98%
MIT

Umami

Analytics

38,642

Privacy-first web analytics that respects your users — self-hosted, cookieless, and GDPR compliant out of the box.

View details
95
Repo Health
83
Technical
70
Dependency
Built with
TypeScript98%
Updated yesterday
TypeScript
85%
Other

Webiny JS

Ecommerce · Blogging · CMS

8,032

Open-source, self-hosted CMS on AWS serverless — a TypeScript framework you extend with code, not a product you configure through a UI.

View details
90
Repo Health
86
Technical
62
Dependency
Built with
TypeScript85%
JavaScript14%
Updated yesterday

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search