A Node.js library for deleting files and directories using glob patterns with a Promise API.
Del is a Node.js library for deleting files and directories using glob patterns. It solves the problem of safely and efficiently removing multiple files with a modern Promise-based API, offering protections against accidental deletion of important directories.
Node.js developers and tooling authors who need programmatic file deletion with pattern matching in build scripts, cleanup tasks, or CLI tools.
Developers choose Del over alternatives like rimraf for its Promise API, glob support, safety features, and additional options like dry runs and progress tracking.
Delete files and directories
Enables deletion of multiple files using expressive patterns, as shown in usage examples with inclusions and exclusions like 'temp/*.js' and '!temp/unicorn.js'.
Provides Promise-based methods with async/await support, making it easy to integrate into contemporary JavaScript codebases, as demonstrated in the deleteAsync function.
Defaults to preventing deletion of the current working directory and parent directories, reducing the risk of catastrophic data loss, a key feature highlighted in the description.
Allows previewing what files would be deleted without actual removal, useful for validation and debugging, as shown in the options with dryRun: true.
The ** pattern can unintentionally match parent directories, requiring explicit ignores to avoid unintended deletions, as warned in the 'Beware' section of the README.
Glob patterns only work with forward-slashes, complicating use on Windows where file paths often use backward-slashes, requiring workarounds like path.posix.join().
For command-line usage, developers must install del-cli separately, adding an extra step and dependency for CLI-focused workflows, as noted in the 'CLI' section.
Parse CSS and add vendor prefixes to rules by Can I Use
Minimal and efficient cross-platform file watching library
Node.js: extra methods for the fs object like copy(), remove(), mkdirs()
User-friendly glob matching
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.