Skip to content

🧟 CLI tool to detect abandoned & unmaintained dependencies in package.json and requirements.txt - find software rot before it becomes a security risk

Notifications You must be signed in to change notification settings

notsointresting/rot-detector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🧟 Dependency Rot Detector

npm version License: MIT npm downloads

Find abandoned dependencies before they become security nightmares.

A CLI tool that scans your package.json (NPM) or requirements.txt (Python) to detect software rot - dependencies that are abandoned, poorly maintained, or pose supply chain risks.

πŸ€” The Problem

npm audit and Snyk tell you about known CVEs. They DON'T tell you:

  • πŸ“… A library hasn't been updated in 4 years
  • πŸ‘€ A package has only 1 maintainer (bus factor risk)
  • βš–οΈ A dependency uses a deprecated license

This is "Software Rot" - a security bomb waiting to explode. πŸ’£

πŸš€ Quick Start

# Install globally
npm install -g rot-detector

# Scan your project
rot-detector scan .

# Or use npx (no install)
npx rot-detector scan ./package.json

πŸ“Š Example Output

🧟 Dependency Rot Detector
Scanned: ./package.json

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Package                β”‚ Score  β”‚ Last Update    β”‚ Maintainers β”‚ License       β”‚ Status     β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ abandoned-lib          β”‚ πŸ”΄ 15  β”‚ 4 years ago    β”‚ 1           β”‚ GPL-2.0       β”‚ Critical   β”‚
β”‚ old-but-ok             β”‚ 🟑 65  β”‚ 8 months ago   β”‚ 2           β”‚ MIT           β”‚ Warning    β”‚
β”‚ react                  β”‚ 🟒 95  β”‚ 2 days ago     β”‚ 15          β”‚ MIT           β”‚ Healthy    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Summary: 🟒 1 Healthy | 🟑 1 Warning | πŸ”΄ 1 Critical

πŸ“‹ Features

Feature Description
πŸ” NPM + PyPI Support Scans package.json and requirements.txt
πŸ“ˆ Health Scoring 0-100 score based on freshness, maintainers, license
🎨 Beautiful CLI Output Color-coded risk indicators
πŸ“Š JSON Export --json flag for CI/CD integration
⚑ GitHub Integration Optional enhanced repo analysis
🚨 Threshold Checks Fail builds if score drops below threshold

βš™οΈ CLI Options

rot-detector scan [path] [options]

Options:
  --json                Output results as JSON
  --threshold <score>   Fail if any dependency scores below threshold
  --github-token <tok>  GitHub token for enhanced repo analysis
  --no-github           Skip GitHub analysis (faster)
  --dev                 Include devDependencies
  -v, --verbose         Verbose output

πŸ† Health Score Breakdown

Each dependency is scored 0-100 based on:

Factor Weight Scoring
Freshness 40% < 6 months = 100, > 3 years = 5
Maintainers 30% 5+ = 100, 1 = 40, 0 = 10
License 30% OSI approved = 100, Unknown = 60

Risk Levels

  • 🟒 Healthy (80-100): Well maintained, safe to use
  • 🟑 Warning (50-79): Review recommended
  • πŸ”΄ Critical (0-49): Replace immediately!

πŸ”§ CI/CD Integration

GitHub Actions

name: Dependency Health Check
on: [push, pull_request]

jobs:
  rot-check:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: '18'
      
      - name: Check for dependency rot
        run: npx rot-detector scan --threshold 50

Pre-commit Hook

# .husky/pre-commit
npx rot-detector scan --threshold 60

πŸ› οΈ Development

# Clone the repo
git clone https://github.com/notsointresting/rot-detector.git
cd rot-detector

# Install dependencies
npm install

# Run in development mode
npm run dev -- scan ./sample/package.json

# Build for production
npm run build

# Run tests
npm test

🀝 Contributing

Contributions are welcome! Feel free to:

  1. πŸ› Report bugs
  2. πŸ’‘ Suggest features
  3. πŸ”€ Submit pull requests

πŸ“„ License

MIT Β© notsointresting


Made with 🧟 by developers who got burned by abandoned dependencies

About

🧟 CLI tool to detect abandoned & unmaintained dependencies in package.json and requirements.txt - find software rot before it becomes a security risk

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published