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-api-scanner

v1.1.4

Published

Scans backend routes and frontend usage to find unused (dead) APIs in your fullstack project.

Downloads

4

Readme

🧠 Dead API Scanner

npm version license Node.js CI/CD Ready

A CLI + programmatic tool to detect unused (dead) REST API endpoints in fullstack JavaScript/TypeScript projects.

Use it to clean up outdated routes, reduce backend bloat, and maintain high-quality code.


🚀 Features

  • ✅ Scans Express-style backend routes (app.get, router.post, etc.)
  • ✅ Detects frontend usage (fetch, axios, axios.create)
  • ✅ Supports dynamic route patterns (e.g. /api/user/:id)
  • ✅ Lists unused (dead) backend API endpoints
  • ✅ CLI and programmatic usage
  • ✅ JSON output for automation
  • ✅ Custom ignore list support (--ignore=/api/ping,...)

📦 Installation

Install globally or use directly with npx:

npm install -g dead-api-scanner
# or
npx dead-api-scanner ./backend ./frontend

🧪 CLI Usage

The ./backend ./frontend arguments represent the paths to your server (API routes) and client (API usage) code.


npx dead-api-scanner ./backend ./frontend

🔍 Dead API Scanner Report ────────────────────────────── 📁 Backend routes scanned : 12 📦 Frontend API used : 9 🗑️ Dead APIs found : 3 ──────────────────────────────

❌ Dead Routes:

  • GET /api/users/all
  • POST /api/admin/create
  • DELETE /api/order/456
npx dead-api-scanner ./backend ./frontend --json


npx dead-api-scanner ./backend ./frontend --ignore=/api/health,/api/ping

Suggestion:

```bash
# Output JSON for CI/CD
npx dead-api-scanner ./backend ./frontend --json

# Ignore specific endpoints
npx dead-api-scanner ./backend ./frontend --ignore=/api/health,/api/ping

📁 Config File Support

You can configure paths and ignored routes using a .deadapirc file in your project root:

{
  "backend": "./backend",
  "frontend": "./frontend",
  "ignore": ["/api/health", "/api/ping"]
}

📦 Programmatic Usage

import { findDeadApis } from 'dead-api-scanner';

const result = findDeadApis('./backend', './frontend', ['/api/health']);

console.log(result);
/*
{
  total: 5,
  used: 3,
  dead: [
    { method: 'GET', route: '/api/users/all' },
    { method: 'POST', route: '/api/admin/create' }
  ]
}
*/

🛠 Supported Patterns


app.get('/api/user', ...)
router.post('/api/login', ...)


fetch('/api/user')
axios.get('/api/user')
api.post('/users') // via axios.create({ baseURL: '/api' })

📄 License

MIT © 2024 iamxerrycan


Made with ❤️ to help developers delete unused code and sleep better.