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-peek

v1.0.2

Published

Peek into your project to find unused dependencies.

Readme

dep-peek

dep-peek is a lightweight CLI tool that helps you peek into your project and identify unused dependencies by analyzing real import usage in your source code.

This tool is read-only and safe by design it does not remove or modify any dependencies.
It simply tells you what is actually used vs what is declared.

⚠️ This is v1 of dep-peek. The focus is correctness and clarity over advanced analysis.


Why dep-peek?

In many projects, dependencies get added over time but never removed.
Unused dependencies:

  • increase bundle size
  • slow down installs
  • add maintenance overhead
  • create security noise

dep-peek solves this by statically analyzing your source files and comparing real usage against package.json.


Features (v1)

  • Works with JavaScript & TypeScript
  • Supports ESM (import) and CommonJS (require)
  • Detects used vs unused dependencies
  • Ignores:
    • relative imports (./, ../)
    • Node.js built-in modules (fs, path, etc.)
  • Handles scoped packages (@babel/parser)
  • Safe, non-destructive, read-only CLI

Installation

Global install (recommended)

npm install -g dep-peek

Usage

Run inside your project root:

dep-peek .

Example output:

Used dependencies:
- fast-glob
- @babel/parser
- @babel/traverse

Unused dependencies:
- chalk
- commander` 

This tells you exactly which dependencies are declared but never used.


How it works (high level)

  1. Scans your project source files (.js, .ts, .jsx, .tsx)

  2. Extracts imports using AST parsing

  3. Normalizes and filters valid external packages

  4. Compares them with package.json dependencies

  5. Reports used vs unused dependencies

No heuristics. No guesses. Just static analysis.


Limitations (v1)

This version intentionally keeps scope limited:

  • Does not analyze devDependencies

  • Does not remove or modify dependencies

  • Does not handle dynamic imports (import() with variables)

  • No config file support yet

  • Path aliases (@/) are treated as external imports

  • Framework-managed dependencies (e.g. react-dom in Next.js) may appear as unused

  • CLI tools installed as dependencies may appear unused

These are planned improvements.

Planned features (future versions)

  • 🔜 devDependencies audit

  • 🔜 --json structured output

  • 🔜 Better reporting & formatting

  • 🔜 Performance optimizations for large codebases


Who is this for?

  • Developers who want to clean up dependency bloat

  • Teams looking for a safe audit tool

  • CI pipelines that want visibility (future versions)

  • Anyone who prefers clarity over magic


Author

Vaibhav Kumar