Read-only discovery
Bare nodehunter prints help. scan lists every node_modules path under your scan root — nothing is removed.
A safety-first CLI for developers who manage many JavaScript projects — discover usage, measure physical disk cost, and delete only when you mean to.
CLI (terminal):
npm install -g nodehunter
# or: pnpm add -g nodehunterSDK (embed in your app):
npm install @nodehunter/core
# or: pnpm add @nodehunter/coreThe nodehunter npm package ships a self-contained CLI (dist/cli.js — core is compiled in at build time, not a runtime dependency on @nodehunter/core). It also publishes a separate nodehunter/core export built from the same engine. For apps, libraries, and CI that import APIs, prefer @nodehunter/core on npm.
Both packages are on npm. Start with SDK examples for runnable scripts, or see the SDK overview for the host contract.
nodehunter # help (default — safe)
nodehunter scan ~/Projects # discover node_modules (read-only)
nodehunter size ~/Projects # physical disk totals + largest projects
nodehunter find react ~/Projects
nodehunter inspect ~/Projects --focus duplicates
nodehunter delete ~/Projects # sized preview, then confirm (default no)Start with scan and size on a scoped path. Use find, why, and inspect when you manage multiple repos or a monorepo. Reserve delete for after you have reviewed the preview.
| Topic | What you will learn |
|---|---|
| Workflows | Audit, investigate, and cleanup recipes |
| find · why · inspect | Cross-project workspace commands |
| CLI overview | Command families and how flags are grouped |
| Discovery flags | -p, -D, -i, -nd, -L |
| Global flags | --json, --yes, cache, debug |
| Safety model | How nodehunter prevents accidental deletion |
| Commands | Per-command reference |
| Platforms | Windows, macOS, Linux — du vs Node sizing |
| SDK | @nodehunter/core — install and host contract |
| SDK examples | Runnable examples/sdk/ scripts |
| SDK exports | Stability tiers and upgrade reports |
| JSON output | Machine-readable envelope for scripts and CI |
Safety-first by design. nodehunter separates finding from deleting. There is no config file to misconfigure — behavior is controlled by explicit commands and flags. Inspired by focused CLI tools like ripgrep and fd: a thin host, clear defaults, and no destructive surprises from aliases or implicit modes.