1.0.0 โข Published 8 months ago
deca-delete v1.0.0
๐๏ธ 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 searchingsuffix
: 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. ๐
1.0.0
8 months ago