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

ai-dead-code

v1.1.0

Published

Find unused exports, functions, and variables in your JavaScript/TypeScript codebase

Readme

ai-dead-code

Find unused exports, functions, and variables in your JavaScript/TypeScript codebase.

Install

npx ai-dead-code

What it does

  • Finds exports that are never imported elsewhere
  • Detects functions that are defined but never called
  • Identifies potentially dead code for cleanup
  • Works with JS, TS, JSX, and TSX files

Usage

# Scan current directory
npx ai-dead-code

# Scan specific directory
npx ai-dead-code -d ./src

# Only check exports (higher confidence)
npx ai-dead-code --exports-only

# Custom extensions
npx ai-dead-code -e js,mjs,cjs

# Ignore specific patterns
npx ai-dead-code --ignore "**/generated/**,**/vendor/**"

# Output JSON report
npx ai-dead-code -o dead-code.json

Example Output

🔍 Dead Code Finder

✔ Scanned 127 files

📊 Results

Total exports found: 234
Total functions found: 512

🚨 Potentially Unused Exports: 8

  src/utils/deprecated.ts
    → export formatLegacyDate
    → export parseLegacyFormat
  
  src/api/oldClient.ts
    → export default OldApiClient
  
  src/helpers/unused.ts
    → export helperThatNobodyUses

⚠️  Potentially Unused Functions: 14

  src/utils/helpers.ts
    → function internalHelper
    → const unusedCalculation
  
  src/components/Form.tsx
    → function validateLegacy

📋 Summary

  Dead code found: 22 items
  Unused exports: 8
  Unused functions: 14

⚠️  Note: Some "unused" code may be used dynamically or in entry points.
   Review before deleting. Run with --exports-only for higher confidence.

Options

| Flag | Description | Default | |------|-------------|---------| | -d, --dir <path> | Directory to scan | . | | -e, --extensions <ext> | File extensions | js,ts,jsx,tsx | | --ignore <patterns> | Patterns to ignore | - | | --exports-only | Only check exports | false | | -o, --output <file> | Save JSON report | - |

What it skips

  • node_modules/
  • dist/ and build/
  • Test files (*.test.*, *.spec.*, __tests__/)
  • Type definitions (*.d.ts)
  • Index files (often re-export)

Confidence Levels

| Finding | Confidence | |---------|------------| | Unused named export | High | | Unused default export | High | | Unused local function | Medium | | Unused arrow function | Medium |

Tips

  1. Start with --exports-only for high-confidence cleanup
  2. Review before deleting - some code may be used dynamically
  3. Check entry points - main.ts, app.tsx are intentionally exported
  4. Run regularly - prevents dead code accumulation

License

MIT


Built by LXGIC Studios 🔗 GitHub · Twitter 💡 Want more free tools like this? We have 100+ on our GitHub: github.com/lxgicstudios