delete
Remove matched node_modules directories under a path. Destructive — always preceded by a sized preview in interactive mode.
bash
nodehunter delete ~/work/big-app
nodehunter delete ~/work --yes # automation only
nodehunter delete ~/work --json --yes # scripted delete with envelopeSafety behavior
| Environment | Behavior |
|---|---|
| Interactive TTY | Sized preview → confirm prompt (default no) |
Non-interactive, no --yes | Refused with guidance |
--yes | Skips prompt; deletes matched directories |
Read the full model: Safety model.
Options
Discovery flags, global flags (including --yes), --top, --full, and:
| Flag | Description |
|---|---|
--concurrency <n> | Parallel size lookups for preview (default 8, max 32) |
Recommended workflow
bash
nodehunter size ~/work --full # review totals
nodehunter delete ~/work/legacy-app # interactive confirmFor CI, run a sized --json preview in an earlier step, then delete with --yes on a scoped path you already validated.
Permissions
Deletion requires write access to each node_modules tree. See Safety model for ownership fixes.
Related
- size — measure before removing
- Workflows — safe cleanup recipes
- JSON output —
summary.counts.deleted