Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

node-officeboy (ob) — the Office Boy for your node_modules

An interactive terminal app (built with Ink + React) to find and permanently delete node_modules folders across your projects.

Why "ob"?

OB stands for Office Boy. If you've ever worked in an Indonesian office, you know the OB: the true MVP who quietly keeps the whole place clean and running while everyone else is busy "being productive". Your disk deserves one too.

This particular OB has exactly one job description: sweep away your dusty, gigantic node_modules folders. He doesn't make coffee. He doesn't do the dishes. He just shows up when you call him (ob), points at the mess, asks "boleh dibuang, Pak/Bu?" — and once you say yes, it's gone. Permanently. No drama, no trash bin, no second thoughts.

Why?

If you work on a lot of JavaScript/TypeScript projects, every single one drags along its own node_modules — often hundreds of MB each. They pile up silently until one day your disk is full and you have no idea where the storage went. I built this because I got fed up hunting them down and deleting them one by one.

ob scans a directory, shows you every project that has a node_modules folder (with its size), lets you pick which ones to nuke, asks for confirmation, and deletes them permanently. Reclaim gigabytes in seconds — you can always npm install again when you actually come back to a project.

Requirements

  • Node.js ≥ 18
  • Works on macOS, Linux, and Windows

Installation

Clone this repo and install dependencies first:

git clone <this-repo-url>
cd node-cleaner
npm install   # also builds dist/cli.js automatically (prepare script)

No manual build step needed — npm install runs the build for you via the prepare script. Then register the global ob command using one of these two options:

Option A: npm install -g . (recommended for regular use)

npm install -g .

This copies the package into npm's global folder. After this you can safely delete the cloned repoob keeps working.

Option B: npm link (for development)

npm link

This creates a symlink pointing to the repo folder. Do not delete the repo — the ob command would break. The upside: edit the source, run npm run build, and the global ob picks up your changes immediately.

Uninstall

Same command for both install options:

npm uninstall -g node-officeboy

This removes the global ob command (and the symlink, if you used npm link). The Office Boy leaves quietly — no severance package required.

Usage

ob            # scan from the current directory
ob ~/code     # scan from a specific directory

It scans recursively (nested projects and monorepos included), skips hidden folders, and never descends into node_modules itself. Sizes are calculated in the background while you browse.

Keyboard

Key Action
/ (or j / k) Move cursor
Space Select / deselect
a Select all / deselect all
Enter Delete selected (asks for confirmation first)
y / n Answer the confirmation prompt
q / Esc Quit

⚠️ Deletion is permanent — folders are removed directly, not moved to trash. That's the point, but you've been warned.

Development

npm install
npm run build   # esbuild: src/*.jsx -> dist/cli.js
npm run dev     # build + run

Since the package is linked with npm link, just run npm run build after editing the source and the global ob command picks up the changes immediately.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages