# del

> Delete files and directories by glob in Node.js, with a promise API

Source: https://talira.ai/catalog/del-x22je8ym
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Library
- Categories: [libraries / filesystem](https://talira.ai/categories/libraries/filesystem), [languages / javascript](https://talira.ai/categories/languages/javascript)
- Licence: MIT[^2]
- Pricing: Free and open source[^1]
- Free tier: yes[^1]
- Backed by: [Sindre Sorhus](https://talira.ai/orgs/sindresorhus.md)

del is a Node.js package that deletes files and directories matching glob patterns, like [rimraf](https://talira.ai/catalog/rimraf-dg86ye06.md) but with a promise API, several patterns at once and negated patterns to keep paths. It refuses to delete the current working directory and the directories above it unless forced, offers a dry run that returns what would be deleted, a concurrency limit, and gitignore-aware exclusions through globby, and returns the deleted paths.

## Links

- GitHub: https://github.com/sindresorhus/del

## Problems it solves

- clean a build directory with glob patterns in a Node.js script
- delete files matching a pattern but keep a few, in Node
- preview which files a cleanup script would delete

## Features

- deletes files and directories by glob patterns, with negations
- promise-based deleteAsync and synchronous deleteSync
- protects the working directory and its parents unless forced
- dry run that returns the paths it would delete
- concurrency limit and gitignore-aware exclusions

## Limitations

- Glob patterns can only use forward slashes; Windows paths with glob characters need path.posix.join()[^1]

## Trust

Overall: 0.46 out of 1.
Signals: maintenance 0.59, adoption 0.63, momentum 0.30, community 0.56, backing 0.30, extensibility 0.00.

- last commit 52 days ago
- 21 commits in the last 90 days
- latest release v9.0.1 52 days ago
- 1.3k GitHub stars
- 24 contributors
- accepts sponsorship (Github, Open Collective, Buy Me A Coffee)
- backed by Sindre Sorhus

## Alternatives

- [rimraf](https://talira.ai/catalog/rimraf-dg86ye06.md): rm -rf for Node.js, cross-platform
- [globby](https://talira.ai/catalog/globby-wn2ptymw.md): Glob matching for Node.js with negated patterns, directory expansion and .gitignore support
- [glob](https://talira.ai/catalog/glob-x01zjgdr.md): Match files using the patterns the shell uses
- [minimatch](https://talira.ai/catalog/minimatch-nfwzcs0d.md): Glob matching for JavaScript, without regular expressions
- [fast-glob](https://talira.ai/catalog/fast-glob-410drv62.md): Very fast and efficient glob library for Node.js

## Sources

[^1]: https://github.com/sindresorhus/del#readme (checked 28 Nov 2026)
[^2]: https://github.com/sindresorhus/del/blob/main/license (checked 28 Nov 2026)
