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

nuke-mods

v1.1.0

Published

Save your Space! A npm package which can delete all the node_modules taking up space from a folder having multiple projects.

Downloads

4

Readme

Nuke-mods 🚀

nuke-mods is a command-line tool to delete all node_modules directories in a specified folder and its subdirectories, with the option to exclude specific folders from deletion. 💻🗑️

No more manual deletion and don't let node_modules eat up your storage!

Features ✨

  • Delete all node_modules directories inside the specified folder and its subfolders.
  • Exclude specific folders (both top-level and nested) from deletion.
  • Process multiple folders at once.
  • Defaults to the current directory if no folder is specified.

Installation ⚙️

Install nuke-mods globally with npm:

npm install -g nuke-mods

Usage 📜

Basic Usage

By default, nuke-mods will delete all node_modules directories inside the current directory:

nuke-mods

Specify Folders to Search

Specify one or more folders to search for node_modules directories:

nuke-mods folder1,folder2

Exclude Specific Folders

Use the --exclude flag to exclude one or more folders (and their node_modules) from deletion. The script will skip deleting node_modules inside these excluded folders:

nuke-mods --exclude=folder3,folder4

You can specify multiple folders to exclude, and they can be nested. The script will only skip node_modules inside the specified folders.

Combine Folders and Exclusions

You can combine both folder specifications and exclusions:

nuke-mods folder1,folder2 --exclude=folder3,folder4

This will:

  • Search for node_modules inside folder1 and folder2.
  • Exclude any node_modules inside folder3 and folder4 (including nested ones).

Examples

  1. Delete node_modules inside the current directory:

    nuke-mods
  2. Delete node_modules inside project-1 and project-2, but exclude node_modules inside project-2/pro-4:

    nuke-mods project-1,project-2 --exclude=project-2/pro-4
  3. Delete node_modules inside project-1, project-2, and project-3, but exclude project-2/pro-4 and project-1/pro-1:

    nuke-mods project-1,project-2,project-3 --exclude=project-2/pro-4,project-1/pro-1

How It Works 🛠️

  1. Target Folders: The script looks for node_modules inside the folders you specify or the current directory by default.
  2. Exclusion Logic: If you specify --exclude, the script will skip deleting node_modules inside those excluded folders, whether they are top-level or nested.

Installation Issues 🚨

If you run into issues with the command not being recognized, ensure the package is installed globally:

npm install -g nuke-mods

You may also need to ensure the script has executable permissions:

chmod +x /path/to/nuke-mods

Accidently deleted node_modules?? No worries just run:

npm install