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

@importdevcoffee/clean-deps

v1.2.1

Published

clean-deps is a CLI tool for detecting and removing unused dependencies with optional flags.

Downloads

15

Readme

@importdevcoffee/clean-deps

🧹 clean-deps

clean-deps is a fast and lightweight CLI-tool for scanning and removing unused dependencies in your Node.js and TypeScript projects. It detects unused import and require statements and lets you clean them up with a simple flag.

Perfect for keeping your codebase clean, lean, production-ready and free from unnecessary bloat.


✨ Features

  • Detects unused dependencies and devDependencies from your package.json

  • Scan your project for actual module usage (imports + script binaries) using the scan command

  • Remove unused dependencies automatically with:

    • Uninstall all unused dependencies by using --clean or -c.

      Want to only uninstall the specified dependencies when using --clean? Use in addition --specify <deps> or -s

      • Example:

        clean-deps scan --clean --specify dep1,dep2,dep3
    • Want to ignore dependencies and make sure that they arent getting uninstalled? Use in addition --ignore

      • Example:

        clean-deps scan --clean --ignore dep2,dep3
    • Want to skip the confirmation dialog when cleaning/deleting? Use --yes or -y.

      • Example:

        clean-deps scan --clean --yes
  • Works with both JavaScript and TypeScript


📦 Installation

Note: It is highly recommended to install clean-deps with the --save-dev flag.

npm install @importdevcoffee/clean-deps --save-dev

You can use your terminal and run the cli-tool from your project directory by using:

npx clean-deps scan [options]

Want to create convenient shortcuts? You can add entries to your scripts inside of your package.json.

For example:

"scripts": 
          {
            "scan": "clean-deps scan",
            "scan:clean": "clean-deps scan --clean",
            "scan:autoclean": "clean-deps scan -c -y",
            ...
          }

You can then simply run the script by using npm run scan which will automatically execute the configured command.


Example

Use this command in your terminal, inside of your project:

npx clean-deps scan

Expect an output similar to this:

Dependencies from script and imports which are in use:
["dep1",    "dep2"
 "dep3",    "dep4",
 ...        ...
]
Unused: []
Found 0 unused dependencies.

Flag Representation in Table-format

Flags

| Flag | Description | | ----------------- | ---------------------------------------------------- | | --clean, -c | Cleanup/uninstall your dependecies | | --specify, -s | Specify which unused dependencies you want to remove | | --yes, -y | Skip confirmation dialog before deleting | | --ignore | Ignore specific dependencies from being removed |


📄 License

This project is licensed under the MIT License


🙌 Contributing

Found a bug or want to improve this tool? PRs and issues are always welcome.