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

@yassine_mbk/debt_collector

v1.0.2

Published

Scan debt TODO/FIXME comments in project files

Readme

💸 Debt Collector

A CLI tool to track and manage technical debt in your codebase by scanning for TODO and FIXME comments.

npm version License: ISC

✨ Features

  • 🔍 Fast scanning - Quickly scan entire projects for TODO and FIXME comments
  • 🎯 Flexible filtering - Support for multiple file extensions and ignore patterns
  • 📊 Multiple output formats - Terminal-friendly or JSON for CI/CD integration
  • 🚨 CI/CD ready - Fail builds when technical debt is detected
  • 🎨 Beautiful output - Color-coded results for better readability
  • High performance - Powered by fast-glob for efficient file scanning

📦 Installation

Global Installation (Recommended)

npm install -g debt-collector

Local Installation

npm install debt-collector --save-dev

🚀 Usage

Basic Usage

Scan a directory for technical debt:

debt debt ./src

Advanced Options

debt debt <directory> [options]

Options

| Option | Alias | Description | Default | |--------|-------|-------------|---------| | --ext <extensions> | -e | File extensions to scan (comma-separated) | js,ts,jsx,tsx | | --ignore <patterns> | -i | Glob patterns to ignore (comma-separated) | | | --json | | Output results in JSON format | false | | --fail-on-debt | | Exit with non-zero code if debts found | false |

Examples

Scan TypeScript files only

debt debt ./src --ext ts,tsx

Ignore node_modules and test files

debt debt ./src --ignore "**/node_modules/**,**/*.test.js"

Generate JSON report

debt debt ./src --json

This creates a debt-report.json file with detailed results.

Fail CI/CD pipeline on debt

debt debt ./src --fail-on-debt

Scan Python files

debt debt ./src --ext py

Combine multiple options

debt debt ./src --ext js,ts,jsx,tsx --ignore "**/dist/**,**/build/**" --fail-on-debt

📋 Detected Patterns

The tool detects technical debt comments in the following formats:

  • // TODO: description
  • // FIXME: description
  • /* TODO: description */
  • # TODO: description (for Python, Ruby, etc.)

Pattern matching is case-insensitive.

📊 Output Format

Terminal Output

Debts found in file: src/components/Header.js
  12: // TODO: Add proper error handling
  45: // FIXME: Memory leak in event listener

Scan complete. Total files scanned: 24. Total debts found: 2.

JSON Output (--json)

{
  "totalFilesScanned": 24,
  "totalDebtsFound": 2,
  "debts": [
    {
      "file": "src/components/Header.js",
      "debts": [
        {
          "line": "// TODO: Add proper error handling",
          "lineNo": 12
        },
        {
          "line": "// FIXME: Memory leak in event listener",
          "lineNo": 45
        }
      ]
    }
  ]
}

🔧 Use Cases

1. Pre-commit Hook

Add to .git/hooks/pre-commit:

#!/bin/bash
debt debt ./src --fail-on-debt

2. CI/CD Pipeline

GitHub Actions:

- name: Check Technical Debt
  run: |
    npm install -g debt-collector
    debt debt ./src --fail-on-debt

GitLab CI:

debt-check:
  script:
    - npm install -g debt-collector
    - debt debt ./src --fail-on-debt

3. NPM Script

Add to package.json:

{
  "scripts": {
    "check-debt": "debt debt ./src",
    "check-debt:strict": "debt debt ./src --fail-on-debt"
  }
}

Then run:

npm run check-debt

4. Generate Reports

# Generate weekly debt report
debt debt ./src --json
mv debt-report.json reports/debt-$(date +%Y-%m-%d).json

🛠️ Development

Project Structure

debt-collector/
├── bin/
│   └── index.js        # CLI entry point
├── package.json
├── package-lock.json
└── README.md

Local Development

# Clone the repository
git clone <your-repo-url>
cd debt-collector

# Install dependencies
npm install

# Link for local testing
npm link

# Test the CLI
debt debt ./test-project

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

📝 License

ISC License - see the LICENSE file for details.

🙏 Acknowledgments

Built with:

📧 Support

If you have any questions or run into issues, please open an issue on GitHub.


Happy debt hunting! 💸🔍