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

scl339-codebase-analyzer

v1.0.0

Published

Analyze local codebases and generate beautiful HTML statistics reports — file counts, language distribution, lines of code, comment ratios, and complexity estimates

Downloads

165

Readme

scl339-codebase-analyzer

Analyze local codebases and generate beautiful HTML statistics reports in seconds.

npm version License: MIT

Features

  • 📊 Comprehensive stats — file count, language distribution, lines of code, comment ratio, blank lines
  • 🧠 Smart analysis — per-language comment detection, cyclomatic complexity estimate
  • 🎨 Beautiful dark-themed HTML report — interactive, responsive, ready to share
  • 🚀 Fast — walks your project directory efficiently with smart exclusions (node_modules, .git, etc.)
  • 🔧 Customizable — add exclude patterns, control output path

Quick Start

# Analyze the current directory
npx scl339-codebase-analyzer analyze .

# Analyze a specific project
npx scl339-codebase-analyzer analyze /path/to/project

# Specify output file
npx scl339-codebase-analyzer analyze . -o my-report.html

# Console-only mode (no HTML)
npx scl339-codebase-analyzer analyze . --no-html

# Exclude additional patterns
npx scl339-codebase-analyzer analyze . --exclude "*.log" "temp"

Output

The command produces two outputs:

  1. Console Report — a colorized summary showing:

    • Total files, lines, code lines, comments, blanks
    • Comment rate and complexity estimate
    • Per-language breakdown with visual bars
  2. HTML Report (codebase-report.html by default) — a beautiful dark-themed page with:

    • Stats cards for all metrics
    • Language distribution with colored bars
    • Detailed code/comment/blank breakdown per language

Example HTML Report Screenshot

The report features a GitHub-dark theme with:

  • Gradient stat cards with hover effects
  • Language bars with GitHub-style colors
  • Responsive layout (mobile-friendly)
  • Cross-links to related SCL339 projects

CLI Options

Usage: scl339-codebase-analyzer analyze [options] [path]

Analyze a codebase and generate a report

Arguments:
  path                          Path to the codebase directory (default: ".")

Options:
  -o, --output <path>           Output HTML file path (default: "codebase-report.html")
  --no-html                     Skip HTML generation, output to console only
  --exclude <patterns...>       Additional exclude patterns (glob)
  -h, --help                    Display help for command

Supported Languages

JavaScript, TypeScript, JSX, TSX, Python, Ruby, Java, Go, Rust, C, C++, C#, Swift, Kotlin, Scala, PHP, Shell, Bash, Zsh, YAML, JSON, XML, HTML, CSS, SCSS, Less, Markdown, SQL, Dockerfile, TOML, Vue, Svelte, and more.

How It Works

  1. Walks the directory tree, excluding common build/artifact directories
  2. Classifies files by extension into supported languages
  3. Analyzes each file for total lines, code lines, comments, blanks
  4. Estimates cyclomatic complexity by counting control flow keywords
  5. Generates a console report and an HTML report

Related SCL339 Projects

Sponsorship

If you find this project useful, please consider sponsoring via Alipay:

Alipay Account: 18559219554

Your support helps maintain and improve this project!

License

MIT © SCL339