![Maven Central Adds Sigstore Signature Validation](https://cdn.sanity.io/images/cgdhsj6q/production/7da3bc8a946cfb5df15d7fcf49767faedc72b483-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Maven Central Adds Sigstore Signature Validation
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
The del-cli package is a command-line tool for deleting files and directories using glob patterns. It is a convenient wrapper around the 'del' module, making it easy to use from the command line.
Delete files
This feature allows you to delete a specific file by providing its path.
del-cli 'path/to/file.txt'
Delete directories
This feature allows you to delete an entire directory and its contents by providing the directory path.
del-cli 'path/to/directory'
Use glob patterns
This feature allows you to use glob patterns to delete multiple files that match the pattern. For example, this command deletes all .txt files in the specified directory.
del-cli 'path/to/files/*.txt'
Force delete
This feature allows you to forcefully delete files or directories that are normally protected. Use with caution.
del-cli 'path/to/file.txt' --force
Dry run
This feature allows you to perform a dry run, showing which files would be deleted without actually deleting them. This is useful for testing your glob patterns.
del-cli 'path/to/files/*.txt' --dry-run
Rimraf is a deep deletion module for node (like `rm -rf`). It is more focused on being a programmatic solution rather than a CLI tool, but it can be used from the command line as well. Rimraf is very robust and handles edge cases like long paths on Windows.
Trash-cli is a command-line tool that moves files and directories to the trash instead of permanently deleting them. This can be safer as it allows for recovery of accidentally deleted files. It is a good alternative if you want a safer deletion process.
Shx is a wrapper around ShellJS Unix commands, providing cross-platform compatibility for shell commands. It includes a `rm` command that can be used to delete files and directories. Shx is useful if you need a broader set of shell commands in addition to deletion.
Delete files and directories
Useful for use in build scripts and automated things.
Note that this does permanent deletion. See trash-cli
for something safer.
npm install --global del-cli
$ del --help
Usage
$ del <path|glob> …
Options
--force, -f Allow deleting the current working directory and outside
--dry-run, -d List what would be deleted instead of deleting
--verbose, -v Display the absolute path of files and directories as they are deleted
Examples
$ del unicorn.png rainbow.png
$ del "*.png" "!unicorn.png"
:warning: Windows users: Since
$ del
is already a builtin command on Windows, you need to use$ del-cli
there.
Benefits over rimraf
CLI: Supports globbing (even on Windows), safer by default as it doesn't allow deleting parent directories, and has a dry-run mode.
Benefits over rm -rf
: Cross-platform, safer by default as it doesn't allow deleting parent directories, and has a dry-run mode.
FAQs
Delete files and directories - Cross-platform
The npm package del-cli receives a total of 199,183 weekly downloads. As such, del-cli popularity was classified as popular.
We found that del-cli demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.