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

@taterraster-js/projectdoctor

v0.1.1

Published

๐Ÿฉบ A production-quality CLI tool that analyzes your codebase and reports its health

Readme

๐Ÿฉบ ProjectDoctor

A production-quality CLI diagnostic tool that analyzes your JavaScript / Node.js codebase and reports its health โ€” with zero external dependencies.

npm version Node.js License: MIT

โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚  ๐Ÿฉบ  ProjectDoctor Report  my-app      โ”‚
โ”‚                                        โ”‚
โ”‚    Project Health:  โš  Needs Attention  โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ

๐Ÿ“Š  Project Stats
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
  Files                      182
  Source files               143
  Lines of code              21,943
  Largest file               src/api.js (612 lines)
  Dependencies               37
  Dev dependencies           14

๐ŸŒฑ  Environment
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
  โœ”  .env file found
  โœ”  .env.example file found
  โš   Missing env variables: 1
     - DATABASE_URL
  โš   Potentially unused env variables: 3
     - OLD_API_KEY

๐Ÿง   Code Mood
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
  TODOs                      21
  FIXMEs                     4
  console.log calls          11
  HACK markers               2
  Mood                       ๐Ÿ˜ฌ stressed

๐Ÿšจ  Possible Issues
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€

  src/user.js
    - unused variable: tempUser (line 42)

  src/api.js
    - empty catch block (line 88)
    - duplicate import: 'lodash' (line 112)

๐Ÿ“ฆ  Dependencies
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
  Production dependencies    37
  Dev dependencies           14
  โš   Potentially outdated: 3
     - express (declared ^4.0.0, installed 3.5.0)
  โš   Possibly unused packages: lodash

โœจ Features

| Feature | Description | |---|---| | Project Stats | Total files, lines of code, largest file, dependency counts | | Code Mood | Counts TODOs, FIXMEs, console.logs and assigns a mood | | Environment Health | Detects missing / unused .env variables vs .env.example | | Issue Finder | Finds empty catch blocks, duplicate imports, unused variables | | Dependency Health | Detects outdated and potentially unused packages |


๐Ÿš€ Quick Start

Run instantly with npx โ€” no installation required:

npx projectdoctor

Or install globally:

npm install -g projectdoctor
projectdoctor

๐Ÿ“ฆ Requirements

  • Node.js โ‰ฅ 18.0.0
  • Zero runtime dependencies โ€” works anywhere Node runs, npx works immediately

๐Ÿงฐ CLI Commands

# Full diagnosis (default)
projectdoctor

# Individual sections
projectdoctor stats       # ๐Ÿ“Š Project file & line statistics
projectdoctor env         # ๐ŸŒฑ Environment variable health
projectdoctor mood        # ๐Ÿง  Code mood analysis
projectdoctor errors      # ๐Ÿšจ Possible code issues
projectdoctor deps        # ๐Ÿ“ฆ Dependency health

# Options
projectdoctor -d ./myapp  # Analyze a specific directory
projectdoctor --version   # Show version
projectdoctor --help      # Show help

๐Ÿ” What Gets Scanned

File extensions included: .js .jsx .mjs .ts .tsx .cjs

Directories ignored: node_modules, .git, dist, build, coverage, .next, .cache, .turbo, .vercel


๐Ÿฉบ Health Levels

| Icon | Level | Condition | |------|-------|-----------| | โœ” Healthy | All clear | Score < 2 | | โš  Needs Attention | Warning | Score 2โ€“4 | | โœ– Critical | Urgent | Score โ‰ฅ 5 |

Score is computed from: stressed mood (+2), missing env vars (+1 each), many file issues (+1โ€“2), many outdated deps (+1).


๐Ÿง  Code Mood Scale

| Mood | Marker Count | Meaning | |------|-------------|---------| | ๐Ÿ˜Š healthy | 0โ€“5 | Clean codebase | | ๐Ÿ˜ moderate | 6โ€“20 | Some cleanup needed | | ๐Ÿ˜ฌ stressed | 21+ | Technical debt accumulating |

Markers counted: TODO, FIXME, HACK, console.log/warn/error/debug


๐ŸŒฑ Environment Analysis

Compares .env against .env.example:

  • Missing vars โ€” keys in .env.example not present in .env
  • Unused vars โ€” keys in .env never referenced as process.env.KEY in source

๐Ÿšจ Code Issues Detected

| Issue | How | |-------|-----| | Empty catch blocks | Heuristic scan for catch {} with no body statements | | console.log/warn/error | Regex across all source files | | Duplicate imports | Tracks seen import/require module paths per file | | Unused variables | const x = โ€ฆ declared once and never referenced again |

These are fast heuristic checks, not a full AST parse. Use ESLint for exhaustive analysis.


๐Ÿ“ฆ Dependency Analysis

  • Outdated โ€” compares declared semver range against the version installed in node_modules
  • Unused โ€” packages never imported or required in source (with a built-in allowlist for implicit deps like dotenv, cross-env, typescript)

๐Ÿ› ๏ธ Debug Mode

DEBUG=1 projectdoctor

Prints full stack traces on unexpected errors.


๐Ÿ“ Project Structure

projectdoctor/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ cli.js                  # CLI entry point & arg parsing
โ”‚   โ”œโ”€โ”€ index.js                # Report orchestration & section printers
โ”‚   โ”œโ”€โ”€ analyzers/
โ”‚   โ”‚   โ”œโ”€โ”€ stats.js            # File/line/dependency counts
โ”‚   โ”‚   โ”œโ”€โ”€ mood.js             # TODO/FIXME/console.log scanner
โ”‚   โ”‚   โ”œโ”€โ”€ env.js              # .env vs .env.example comparison
โ”‚   โ”‚   โ”œโ”€โ”€ errors.js           # Common code issue detector
โ”‚   โ”‚   โ””โ”€โ”€ deps.js             # Dependency health checker
โ”‚   โ””โ”€โ”€ utils/
โ”‚       โ”œโ”€โ”€ colors.js           # Zero-dep ANSI color helpers
โ”‚       โ”œโ”€โ”€ display.js          # Terminal output (sections, rows, boxes)
โ”‚       โ””โ”€โ”€ fs.js               # File system walking utilities
โ”œโ”€โ”€ package.json
โ””โ”€โ”€ README.md

๐Ÿค Contributing

  1. Fork the repo
  2. Create a feature branch: git checkout -b feat/my-feature
  3. Commit: git commit -m 'feat: add X'
  4. Push and open a Pull Request

๐Ÿ“„ License

MIT ยฉ ProjectDoctor