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

dep-sweeper

v1.1.0

Published

Analyze a project and remove unused dependencies, devDependencies, or duplicate versions across monorepos. Check for compatible dependencies.

Readme

dep-sweeper

🧹 A powerful tool to analyze and clean up your project dependencies. Remove unused dependencies, find duplicates across monorepos, and check for compatibility issues.

Features

  • 🔍 Unused Dependency Detection: Scan your codebase and identify dependencies that are not being used
  • 🚫 Automatic Cleanup: Automatically remove unused dependencies and devDependencies
  • 🔄 Duplicate Resolution: Find and automatically fix duplicate versions of packages across monorepo workspaces
  • Compatibility Auto-Fix: Automatically resolve version conflicts and install missing peer dependencies
  • 🤖 Full Auto-Fix Mode: One command to fix all issues automatically
  • 📊 Detailed Reports: Get comprehensive analysis reports with actionable insights
  • 🎯 Monorepo Support: Full support for Lerna, Rush, Yarn Workspaces, and npm workspaces

Installation

# Global installation
npm install -g dep-sweeper

# Local installation
npm install --save-dev dep-sweeper

Usage

Command Line Interface

# Analyze current directory
dep-sweeper analyze

# Analyze specific directory
dep-sweeper analyze ./my-project

# Remove unused dependencies (dry run by default)
dep-sweeper clean

# Automatically remove unused dependencies
dep-sweeper clean --auto

# Apply changes after review
dep-sweeper clean --apply

# Fix duplicate versions automatically
dep-sweeper fix-duplicates --auto

# Fix compatibility issues automatically
dep-sweeper fix-compatibility --auto

# Auto-fix everything (unused, duplicates, compatibility)
dep-sweeper auto-fix --auto

# Check for duplicates in monorepo
dep-sweeper duplicates

# Check compatibility
dep-sweeper compatibility

# Full analysis with all checks
dep-sweeper audit

Automatic Fixing

dep-sweeper can automatically fix issues without manual intervention:

# Auto-fix everything in one command
dep-sweeper auto-fix --auto

# Fix only unused dependencies automatically
dep-sweeper clean --auto

# Fix only duplicate versions
dep-sweeper fix-duplicates --auto

# Fix only compatibility issues
dep-sweeper fix-compatibility --auto
  • --apply: Apply changes instead of dry run
  • --ignore <patterns>: Ignore specific packages or patterns
  • --include-dev: Include devDependencies in analysis
  • --verbose: Show detailed output
  • --format <type>: Output format (json, table, csv)

Programmatic API

import { DepCleaner } from 'dep-sweeper';

const cleaner = new DepCleaner({
  projectPath: './my-project',
  includeDev: true
});

// Analyze unused dependencies
const analysis = await cleaner.analyzeUnused();
console.log(analysis);

// Find duplicates
const duplicates = await cleaner.findDuplicates();
console.log(duplicates);

// Check compatibility
const compatibility = await cleaner.checkCompatibility();
console.log(compatibility);

Configuration

Create a .dep-sweeper.json file in your project root:

{
  "ignore": ["react", "@types/*"],
  "includeDev": true,
  "monorepo": {
    "type": "lerna",
    "workspaces": ["packages/*"]
  },
  "compatibility": {
    "strict": false,
    "checkPeerDeps": true
  }
}

Examples

Basic Project Cleanup

# Navigate to your project
cd my-project

# Run analysis
dep-sweeper analyze

# Auto-fix all issues
dep-sweeper auto-fix --auto

# Or clean unused dependencies manually
dep-sweeper clean --apply

Monorepo Management

# Auto-fix duplicates across workspaces
dep-sweeper fix-duplicates --auto

# Or check and manually fix duplicates
dep-sweeper duplicates --verbose
dep-sweeper fix-duplicates --apply

Output Examples

Unused Dependencies Report

🔍 Analyzing dependencies...

📦 Found 3 unused dependencies:
  ❌ lodash (4.17.21) - Last used: never
  ❌ moment (2.29.4) - Last used: never
  ❌ axios (0.27.2) - Last used: never

💾 Potential savings: 2.3MB

🔧 Run with --apply to remove unused dependencies

Duplicate Dependencies Report

🔄 Checking for duplicates across workspaces...

📦 Found 2 duplicate packages:
  ⚠️  react
    └── packages/web: 18.2.0
    └── packages/mobile: 17.0.2
    └── packages/shared: 18.1.0

  ⚠️  typescript
    └── packages/api: 4.8.4
    └── packages/web: 4.9.3

License

MIT © [Your Name]

Contributing

Contributions are welcome! Please read our contributing guidelines and submit pull requests to our repository.

Support