depth-cleaner-cli
v1.0.0
Published
it deletes files/folders permanently as per depth
Maintainers
Readme
Depth Cleaner CLI 🚀

“Because nobody likes node_modules lurking everywhere…”
What is Depth Cleaner CLI?
Depth Cleaner CLI is your no-nonsense, zero-dependencies, recursive file & folder cleaner for Node.js projects (and beyond!).
Tired of manually hunting down and deleting node_modules folders, old logs, pesky temp files, or any unwanted clutter in your project directories? Depth Cleaner CLI has your back.
- Delete any files or folders by name
- Control how deep you want to go — from "just the surface" to "scorched earth"
- One prompt to rule them all (confirm once, delete all)
- Dry-run mode to preview your clean-up without breaking a sweat
- No external dependencies — pure Node.js goodness
Why Depth Cleaner CLI?
- Stop wasting time deleting
node_modulesone by one. - Avoid mistakes by previewing deletions with
--dry-run. - Clean up anything, anywhere, any depth.
- Works on all platforms (Linux, macOS, Windows).
- No installation headaches — lightweight, easy to use, easy to trust.
Installation
You can install it globally (once published on npm):
npm install -g depth-cleaner-cliUsage
npx depth-cleaner [options] <name[-depth]> [<name[-depth]> ...]name — the filename or folder name you want to delete
-depth — optional max recursion depth (e.g.,
node_modules-1deletes only at depth 1)options:
--dry-run— Show what would be deleted without actually deleting--help— Show usage info
Examples
Delete all node_modules folders recursively from current directory
npx depth-cleaner node_modulesDelete all logs folders, but only up to 2 levels deep
npx depth-cleaner logs-2Delete multiple things at once
npx depth-cleaner node_modules logs temp-1 file.txtDry-run to preview deletions before making changes
npx depth-cleaner node_modules --dry-runHow Depth Works
Depth counts how deep a folder/file is relative to where you run the command (.).
node_modules-0means only deletenode_modulesin the current directorylogs-1means deletelogsfolders in the current directory and one level down- If no
-depthis given, it deletes all matching files/folders no matter how deep
Use Cases
- Quickly clear all
node_modulesfolders before a freshnpm install - Clean temporary log folders created by your app in development
- Remove build artifacts like
distorbuildfolders scattered across subprojects - Delete old cache files or specific temp files across a mono-repo or project tree
- Help you automate clean-up scripts in your CI/CD pipelines
No External Dependencies
Depth Cleaner CLI is built using only Node.js core modules — no commander, inquirer, or chalk bloat. Lightweight and lightning-fast.
Error Handling & Safety
- Permission errors or unreadable directories warn you but don’t crash
- You must confirm deletion once before anything is removed
--dry-runlets you safely preview what will be deleted
Contributing
Contributions, bug reports, and feature requests are welcome! Feel free to open an issue or PR on GitHub.
Final Note
Use Depth Cleaner CLI responsibly — it deletes files/folders permanently! Always use --dry-run if you want to play it safe.
Happy cleaning! 🧹✨
About the Author
👋 Hey there! I'm cinfinit, a passionate developer who loves crafting simple, powerful tools to make life easier for fellow coders.
When I'm not busy wrangling Node.js projects or battling pesky node_modules folders, you’ll find me tinkering with open-source, sharing knowledge, or wondering about life, universe and everything.
If you find Depth Cleaner CLI useful, feel free to ⭐️ the repo, share feedback, or reach out
