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

@oxog/nmc

v1.0.1

Published

Zero-dependency Node.js tool for finding, analyzing, and cleaning node_modules directories

Readme

@oxog/nmc - Node Modules Cleaner

npm npm downloads Codecov License Dependencies Node GitHub stars

🚀 A zero-dependency, lightning-fast CLI tool for managing node_modules directories

InstallationQuick StartCommandsWeb UIContributing

🎯 Why NMC?

Ever wondered how much disk space your node_modules folders are consuming? NMC helps you:

  • 📊 Visualize disk usage across all your projects
  • 🔍 Find duplicate packages and outdated modules
  • 🧹 Clean unused node_modules with confidence
  • 💾 Save gigabytes of disk space
  • Speed up your development environment

✨ Features

Core Features

  • 🚫 Zero Dependencies - Built entirely with Node.js native APIs
  • 🌍 Cross-Platform - Works seamlessly on Windows, macOS, and Linux
  • Lightning Fast - Parallel scanning with optimized algorithms
  • 🛡️ Safe Operations - Dry-run mode, backup options, validation checks
  • 🎨 Beautiful CLI - Colored output, progress bars, interactive mode
  • 🌐 Web Interface - Modern browser-based UI for visual management

Advanced Features

  • 📈 Smart Analysis - Find duplicates, analyze trends, get insights
  • 🔄 Multiple Strategies - Clean by age, size, or duplicates
  • 📝 Detailed Reports - Export results in JSON, CSV, or HTML
  • 🎯 Precise Filtering - Glob patterns, size thresholds, age limits
  • 🔒 Security First - Path validation, gitignore checks, safe deletion
  • 🌙 Dark Mode - Eye-friendly interface for the web UI

📦 Installation

# Global installation (recommended)
npm install -g @oxog/nmc

# Or using yarn
yarn global add @oxog/nmc

# Or run directly with npx
npx @oxog/nmc scan

🚀 Quick Start

# Scan current directory for node_modules
nmc scan

# Analyze your projects folder
nmc analyze ~/projects

# Clean with interactive selection
nmc clean ~/projects --interactive

# Launch web interface
nmc web --open

📖 Commands

🔍 scan [path]

Find all node_modules directories in the specified path.

nmc scan ~/projects --depth 5 --sort size

Options:

  • --depth <n> - Maximum directory depth (default: 10)
  • --sort <field> - Sort by: size, date, name, packages
  • --limit <n> - Limit number of results
  • --min-size <MB> - Minimum size threshold
  • --exclude <patterns> - Exclude paths (glob patterns)
  • --json - Output as JSON

Example Output:

📦 Found 12 node_modules directories (3.2 GB total)

┌─────┬──────────────────────┬──────────┬──────────┬───────────┐
│ #   │ Project              │ Size     │ Packages │ Modified  │
├─────┼──────────────────────┼──────────┼──────────┼───────────┤
│ 1   │ my-app               │ 523 MB   │ 1,234    │ 2 days    │
│ 2   │ another-project      │ 412 MB   │ 987      │ 1 week    │
└─────┴──────────────────────┴──────────┴──────────┴───────────┘

📊 analyze [path]

Analyze node_modules for duplicates and statistics.

nmc analyze ~/projects --find-duplicates

Options:

  • --find-duplicates - Find duplicate packages
  • --min-size <MB> - Minimum size threshold
  • --max-age <days> - Maximum age in days
  • --show-versions - Show package versions

Example Output:

📊 Analysis Results

Total Size: 3.2 GB
Total Projects: 12
Total Packages: 5,432
Unique Packages: 892

🔄 Top Duplicates:
• react (18.2.0): Found in 8 projects (120 MB total)
• lodash (4.17.21): Found in 6 projects (45 MB total)
• webpack (5.89.0): Found in 5 projects (230 MB total)

💡 Recommendations:
• Consider using pnpm for better deduplication
• 5 projects haven't been used in 30+ days
• Potential space savings: 1.8 GB

🧹 clean [paths...]

Clean specified node_modules directories.

nmc clean ./old-project --backup --dry-run

Options:

  • --dry-run - Preview what would be deleted
  • --backup - Create backup before deletion
  • --force - Skip confirmation prompts
  • --interactive - Interactive selection mode
  • --older-than <days> - Clean if older than X days
  • --larger-than <MB> - Clean if larger than X MB

🌐 web [path]

Launch web interface for visual management.

nmc web --port 3001 --open

Options:

  • --port <n> - Server port (default: 3001)
  • --host <string> - Server host (default: localhost)
  • --open - Open browser automatically
  • --no-color - Disable colored output

🎨 Web Interface

The web UI provides:

  • 📊 Interactive dashboard with charts
  • 🗂️ Project explorer with search
  • 📈 Disk usage visualization
  • 🔄 Real-time updates
  • 🎯 Bulk operations
  • 📱 Responsive design

⚙️ Configuration

Create .nmcrc or nmc.config.json in your home directory:

{
  "defaultPath": "~/projects",
  "maxDepth": 5,
  "excludePaths": ["**/vendor/**", "**/.*"],
  "autoBackup": true,
  "colors": true,
  "interactive": true
}

🤝 Contributing

We welcome contributions! Please see our Contributing Guide for details.

Development Setup

# Clone the repository
git clone https://github.com/ersinkoc/NodeModulesCleaner.git
cd NodeModulesCleaner

# Install dependencies
npm install

# Run in development mode
npm run dev

# Run tests
npm test

# Build for production
npm run build

Project Structure

NodeModulesCleaner/
├── src/
│   ├── cli/          # CLI components
│   ├── core/         # Core functionality
│   ├── lib/          # Utilities
│   └── types/        # TypeScript types
├── tests/            # Test files
└── web-ui/           # Web interface

📄 License

MIT © Ersin Koç

🔗 Links


Made with ❤️

⬆ Back to top