npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

depth-cleaner-cli

v1.0.0

Published

it deletes files/folders permanently as per depth

Readme

Depth Cleaner CLI 🚀 NPM version NPM downloads

“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_modules one 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-cli

Usage

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-1 deletes 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_modules

Delete all logs folders, but only up to 2 levels deep

npx depth-cleaner logs-2

Delete multiple things at once

npx depth-cleaner node_modules logs temp-1 file.txt

Dry-run to preview deletions before making changes

npx depth-cleaner node_modules --dry-run

How Depth Works

Depth counts how deep a folder/file is relative to where you run the command (.).

  • node_modules-0 means only delete node_modules in the current directory
  • logs-1 means delete logs folders in the current directory and one level down
  • If no -depth is given, it deletes all matching files/folders no matter how deep

Use Cases

  • Quickly clear all node_modules folders before a fresh npm install
  • Clean temporary log folders created by your app in development
  • Remove build artifacts like dist or build folders 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-run lets 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