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

@hitorisensei/check-unused-deps

v0.9.0

Published

Another tool to analyze the JS/TS codebase for unused dependencies

Readme

@hitorisensei/check-unused-deps

Finds unused dependencies in your package.json. That's it.

What it does

Scans your code with ts-morph (the TypeScript AST thing) and checks what you're actually importing. Works with TypeScript and JavaScript files - all the extensions, doesn't matter.

Picks up:

  • Regular imports
  • Dynamic imports
  • require() calls
  • Re-exports

Also checks:

  • npm scripts (for stuff like jest, eslint)
  • ESLint config files (handles plugin shorthand and all that)
  • tsconfig.json and other configs
  • @types packages (only marks them used if you use the actual package, except @types/node which is always kept)
  • Peer dependencies

Install

npm install -g @hitorisensei/check-unused-deps

Or just:

npx @hitorisensei/check-unused-deps

How to use

check-unused-deps                              # Run it
check-unused-deps /some/path                   # Or point it somewhere
check-unused-deps --report                     # Get a detailed text file
check-unused-deps /some/path --report          # Both

Output looks like

📦 Reading package.json...
Found 50 dependencies to check

🔍 Scanning codebase for imports...
Found 234 source files to scan

✅ Finished scanning 234 files

... (does its thing checking scripts, configs, etc)

════════════════════════════════════════════════════════════
RESULTS
════════════════════════════════════════════════════════════

⚠️  Found 3 potentially unused dependencies:

📦 Unused in dependencies:
   - unused-package-1

🔧 Unused in devDependencies:
   - unused-dev-package-1
   - unused-dev-package-2

════════════════════════════════════════════════════════════
Total dependencies: 50
Used dependencies: 47
Potentially unused: 3
════════════════════════════════════════════════════════════

With --report you get a text file with details on where everything is used.

Heads up

This thing isn't perfect. Might flag stuff that's actually needed if you're doing weird dynamic imports with variables or using some obscure config files I didn't think of.

Also don't blindly delete everything it suggests. Check first. I'm not responsible for your broken builds.

It's pretty good at catching the common stuff though - build tools, eslint plugins, @types packages, etc.

Requirements

  • Node 18.12+
  • A package.json

Dev stuff

npm install
npm run build
npm test

Code's split into modules if you want to poke around:

  • types.ts - interfaces
  • package-analyzer.ts - reads package.json
  • import-scanner.ts - scans code with ts-morph
  • config-scanner/ - checks different config files
  • dependency-detector.ts - handles special cases
  • report-generator.ts - makes the report
  • index.ts - ties it all together

If you want to add support for more config files or whatever, the code should be straightforward enough to figure out where it goes.

License

MIT


Made because I got tired of manually checking this stuff and other libraries were very slow on large projects.