Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
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 262,871 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
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.