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

dead-code-ai

v0.1.0

Published

Static analyzer that finds semantically useless code using LLM reasoning

Readme

dead-code-ai

A static analyzer that finds semantically useless code — not just syntactically unused variables (ESLint already does that).

$ npx dead-code-ai src/

dead-code-ai demo npm license


What it finds that ESLint can't

| Pattern | Example | |---|---| | Result computed, never used | const x = heavyFn(); return otherThing; | | Condition always true/false | if (env === 'prod' && env !== 'prod') | | Argument never referenced | function add(a, b, c) { return a + b; } | | Object built, never read | const obj = {a: 1}; doSomethingElse(); | | Loop result discarded | items.forEach(x => total += x); return 0; | | Immediate reassign before read | let x = compute(); x = 0; use(x); | | Redundant double-computation | validate(data); validate(data); save(data); |

ESLint catches let x = 1; with no usage. dead-code-ai catches semantic waste — code that runs but whose result is meaningless in context.


Install

npm install -g dead-code-ai
# or use directly
npx dead-code-ai

Usage

# Analyze current directory
dead-code-ai

# Analyze specific files or directories
dead-code-ai src/ lib/utils.ts

# Only report high-severity issues
dead-code-ai --min-severity high src/

# Output JSON (for CI integration)
dead-code-ai --json src/ > report.json

# Custom extensions
dead-code-ai --ext .ts,.tsx src/

Setup

Get a free API key at console.groq.com and set it:

export GROQ_API_KEY=gsk_...

Or pass it inline:

dead-code-ai --key gsk_... src/

CI Integration

# .github/workflows/dead-code.yml
- name: Check for semantic dead code
  run: npx dead-code-ai --min-severity high --json src/
  env:
    GROQ_API_KEY: ${{ secrets.GROQ_API_KEY }}

How it works

  1. Parse — Babel AST extracts every function/method in your codebase
  2. Batch — Functions are grouped into batches of 6 to minimize API calls
  3. Analyze — Each batch is sent to llama-3.3-70b-versatile via Groq with a strict prompt focused on semantic analysis
  4. Report — Findings are printed with file, line, severity, and the exact problematic snippet

Options

| Flag | Default | Description | |---|---|---| | --key | $GROQ_API_KEY | Groq API key | | --ext | .js,.jsx,.ts,.tsx,.mjs,.cjs | File extensions to analyze | | --min-severity | low | Minimum severity: high, medium, low | | --json | off | Output raw JSON instead of formatted output |

Severity levels

  • ● high — Code that provably does nothing (always-false branch, result always discarded)
  • ◆ medium — Code that likely does nothing in most contexts
  • ○ low — Code that is suspicious and worth reviewing

Supported languages

  • JavaScript (.js, .mjs, .cjs)
  • TypeScript (.ts)
  • React (.jsx, .tsx)

License

MIT — built by iamadhitya1