1.1.0 • Published 5 months ago
sad-cli v1.1.0
sad-cli 🔍🗑️
Search and Delete CLI (SAD-CLI) is a simple Node.js tool that allows you to search for files/folders and delete them interactively.
📌 Installation
Run it without installing:
npx sad-cli <folder-path> <name-to-delete1> <name-to-delete2> ... --ignore <ignore1> <ignore2> ...
Or install it globally:
npm install -g sad-cli
Or install it in a Node.js project:
npm install sad-cli
🚀 Usage
1️⃣ CLI Mode
sad-cli <folder-path> <name-to-delete1> <name-to-delete2> ... --ignore <ignore1> <ignore2> ...
Examples 1️⃣ Delete test.txt but ignore important.txt
npx sad-cli /path/to/folder test.txt test.mp3 --ignore important.txt important2.pdf
2️⃣ Delete node_modules but ignore essential_modules
npx sad-cli ./my-project node_modules --ignore essential_modules
2️⃣ Node.js Module Mode
const sadCli = require("sad-cli");
(async () => {
await sadCli("./my-folder", ["old-file.txt"], ["important-folder"]);
})();
🔹 Features
- ✅ Logs directory structure before scanning
- ✅ Skips ignored files/folders
- ✅ Does not scan inside ignored folders
- ✅ Prompts confirmation before deletion
MIT Licensed | Author: EmmsDan