Socket
Socket
Sign inDemoInstall

del-cli

Package Overview
Dependencies
6
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

del-cli


Version published
Maintainers
1
Install size
1.77 MB
Created

Package description

What is del-cli?

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.

What are del-cli's main functionalities?

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

Other packages similar to del-cli

Readme

Source

del-cli

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.

Install

npm install --global del-cli

Usage

$ 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.

Comparison

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.

  • del - API for this module
  • trash-cli - Move files and directories to the trash
  • make-dir-cli - Make directories and their parents if needed

Keywords

FAQs

Last updated on 31 Aug 2023

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc