Socket
Book a DemoInstallSign in
Socket

deca-delete

Package Overview
Dependencies
Maintainers
0
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

deca-delete

A simple tool to recursively delete files with a specific suffix in a directory.

latest
npmnpm
Version
1.0.0
Version published
Maintainers
0
Created
Source

🗑️ deca-delete

A Node.js CLI tool for recursively deleting files with a specific file suffix across directories. 🗂️🔍

📦 Installation

Install globally using npm:

npm install -g deca-delete

Or as a development dependency in your project:

npm install --save-dev deca-delete

🚀 Usage

CLI Usage

deca-delete <rootDirectory> <fileSuffix>

Examples:

Delete all JavaScript test files: 🧪

deca-delete ./src .test.js

Delete all text files: 📄

deca-delete /path/to/project .txt

Programmatic Usage 💻

const { deleteFilesBySuffix } = require('deca-delete');

deleteFilesBySuffix('/path/to/directory', '.js');

✨ Features

  • 🔄 Recursively search and delete files with a specific suffix
  • 🖥️ Simple CLI interface
  • 🛡️ Error handling for directory and file operations
  • 📝 Detailed console logging

🛠️ Options

  • rootDir: The root directory to start searching
  • suffix: The file suffix to match (must start with a '.')

⚠️ Safety Notes

⚠️ Caution: This tool permanently deletes files. Always double-check your directory and suffix before running. 🚨

🐛 Error Handling

  • Invalid directories will produce an error message
  • Files that cannot be deleted will log an error without stopping the entire process

📄 License

MIT

🤝 Contributing

Contributions are welcome! Please open an issue or submit a pull request on the GitHub repository. 🌟

Keywords

delete

FAQs

Package last updated on 06 Dec 2024

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