Skip to content

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 envelope

Safety behavior

EnvironmentBehavior
Interactive TTYSized preview → confirm prompt (default no)
Non-interactive, no --yesRefused with guidance
--yesSkips prompt; deletes matched directories

Read the full model: Safety model.

Options

Discovery flags, global flags (including --yes), --top, --full, and:

FlagDescription
--concurrency <n>Parallel size lookups for preview (default 8, max 32)
bash
nodehunter size ~/work --full          # review totals
nodehunter delete ~/work/legacy-app    # interactive confirm

For 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.