node-cache-cleaner
Node Cache Cleaner¶
Cleans NPM, Yarn, and NPX caches in parallel.
Usage¶
Options¶
| Option | Description |
|---|---|
-h, --help |
Show this help message |
-g, --global |
Also clean NPM, Yarn, and NPX global caches |
Description¶
- Default mode (no flags): Removes project-level Yarn Berry offline cache files (
.yarn/cache*,.yarn/*.gz) only - With
-g/--global: Runs all global cache cleaners in parallel after the project-level Yarn clean: npm cache clean --forceto clean the NPM cacheyarn cache clean(oryarn cache clean --allfor Yarn Berry) to clean the Yarn global cache- NPX cache cleanup (
_npx,_cacache,.cache/npxdirectories) - All operations run in parallel via
Promise.allSettled - Exits with code 0 on success, or 1 if any cache clean operation fails
Source¶
See src/node-cache-cleaner-cli.ts (modules in src/cache-cleaner/).
Yarn Cache Cleaner (Python)¶
Python-based utility to clean Yarn caches.
Usage¶
Description¶
Runs yarn-clean.py which locates and cleans Yarn cache directories. Available as a shell wrapper in both bash and batch variants.
Source¶
See bin/yarn-clean & bin/yarn-clean.py
yc / ycw¶
Shell scripts to clean node_modules directories in parallel.
Usage¶
Options¶
| Option | Description |
|---|---|
-h, --help |
Show help message |
-c, --concurrent <num> |
Maximum parallel jobs (default: 4) |
Description¶
yc— Cleansnode_modulesvia letter-based parallel deletion of top-level entries (a-z) insidenode_modules/ycw— Yarn workspaces–aware variant. Detects monorepo root, expands workspace globs, and cleansnode_modulesacross root + all workspace packages in parallel
Source¶
Node Modules Cleaner¶
Recursively finds and removes node_modules directories.
Aliases¶
del-nodemodules(default)del-node-modules
Usage¶
Options¶
| Option | Description |
|---|---|
--force, -f |
Actually delete (default is dry-run mode) |
-c, --concurrent N |
Set concurrent removals (default: 2, or CPU count) |
-h, --help |
Show help message |
Description¶
- Searches for all
node_modulesdirectories recursively - Also removes
package-lock.json,yarn.lock, and.yarn/cachedirectories - By default runs in dry-run mode (shows what would be deleted)
- Pass
--forceto actually perform deletion
Source¶
Yarn Cache Cleaner¶
Deletes Yarn cache directories and cached .gz files.
Aliases¶
del-yarncaches(default)del-yarn-caches
Usage¶
Description¶
Finds and deletes all .yarn/cache* directories and .yarn/*.gz files under the current working directory, excluding .git and vendor directories.
Source¶
Remove Node Modules (Fast)¶
Alternative tool for removing node_modules — faster for very large projects. Removes subfolders by first-letter in parallel.
Aliases¶
rm-node-modules(default)rm-node-moduleremove-node-modulesremove-node-module
Usage¶
Options¶
| Option | Description |
|---|---|
--force |
Actually delete (default is dry-run mode) |
-h, --help |
Show help message |
Description¶
- Removes
node_modulessubfolders by first-letter in parallel (a-z, A-Z) - Writes and executes a temporary shell script (auto-removed after completion)
- On Windows requires a Unix-compatible shell in
PATH(e.g., Git Bash or WSL)
Examples¶
npx --legacy-peer-deps -y binary-collections rm-node-modules
npx --legacy-peer-deps -y binary-collections rm-node-modules --force
yarn run rm-node-modules
Source¶
See src/rm-node-module-cli.cjs.