npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

stale-modules

v0.2.5

Published

Interactive CLI that finds node_modules folders in projects you haven't touched in a while and lets you reclaim disk space

Readme

stale-modules

CI npm

Find node_modules folders in projects you haven't touched in a while, and reclaim the disk space — through a fast, friendly interactive CLI.

Works on macOS, Linux, and Windows.

Old side-projects quietly hoard gigabytes in node_modules. stale-modules scans a folder full of projects, finds the ones you haven't worked on in a while, shows you how much space each is wasting, and lets you delete the node_modules with a single confirmation. Your source code is never touched — a quick npm install brings any project back to life.


Quick start

No install needed:

npx stale-modules

Then just answer the prompts.


Usage

npx stale-modules                 # asks which folder to scan
npx stale-modules --base ~/code   # scan ~/code directly, skip the folder question

What happens

  1. Which folder? — point it at the directory that holds your projects (e.g. ~/code).
  2. How many days of inactivity = "stale"? — e.g. 30. Projects untouched for at least that long show up.
  3. Pick what to delete — a checklist of stale projects, each with its node_modules size and how long it's been idle, biggest first.
  4. Confirm — nothing is deleted until you explicitly say yes.

Keyboard controls

Every screen shows its controls, but for reference:

| Key | Action | | --- | --- | | / | Move up / down the list | | Space | Select / deselect the highlighted project | | a | Select / deselect all | | Enter | Confirm and continue | | Esc | Cancel and quit (nothing is deleted) |

Flags

  • --base <path> — skip the folder prompt and scan this path directly.

How "inactive" is determined

stale-modules looks at the most recent modification time of your actual source files (ignoring node_modules, .git, and build output like dist, build, .next, .cache, .turbo).

It deliberately does not use git commit history. Plenty of people work locally for a long time without committing, so a project's real activity is better reflected by when its files were last touched than by when they were last pushed.

Hidden/dot directories (.npm, .npm-global, .cache, .nvm, …) are skipped entirely — they hold global installs, caches, and tooling, not projects, so their node_modules are never offered for deletion.


Safety

  • Only ever deletes directories literally named node_modules. Every deletion is guarded — any path whose final segment isn't node_modules is refused.
  • Nothing is deleted without an explicit confirmation step (which defaults to No).
  • Deleting node_modules never touches your source code. It's fully recoverable — just run npm install in the project again.

Local install (for development)

Clone the repo and link it so the stale-modules (and short alias nmclean) commands work from anywhere:

git clone https://github.com/danilashk/stale-modules.git
cd stale-modules
npm install
npm link          # creates global `stale-modules` / `nmclean` commands

nmclean --base ~/code   # run from any folder

npm unlink -g stale-modules   # undo when you're done

Requirements

  • Node.js >= 18
  • Works on macOS, Linux, and Windows (verified in CI)

License

MIT