1.0.0 โ€ข Published 8 months ago

deca-delete v1.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
8 months ago

๐Ÿ—‘๏ธ 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. ๐ŸŒŸ

1.0.0

8 months ago