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

codesummary

v1.2.2

Published

Cross-platform CLI tool that generates PDF documentation and LLM-optimized Markdown for direct use with any chat-based LLM. Perfect for code reviews, audits, and AI-assisted development.

Readme

CodeSummary

npm version Node.js Version License: GPL v3 Cross-Platform

A cross-platform CLI tool that scans your project's source code and generates repository documentation optimized for both human review and Large Language Models (LLMs).

  • LLM Markdown — Token-optimized single file designed for direct consumption by any chat-based AI.
  • PDF Documentation — Clean, professional A4 reports for code reviews, audits, and archival.
  • Structured Context — Emits .llmsummary.json for downstream agentic workflows.

🚀 Key Features

  • LLM-First Output: Optimized Markdown with lossless compression (whitespace stripping, JSON compaction) to maximize context window efficiency.
  • Deep Dependency Analysis: Internal file-level graph engine with centrality metrics and hub/node identification.
  • Semantic Clustering: Heuristic-based capability grouping (CLI, logic, utilities, etc.) to help AI understand project structure.
  • Language-Aware Extraction: Specialized adapters for JavaScript/TypeScript and Python, with a universal fallback for 50+ other languages.
  • Professional PDF Reports: High-quality snapshots including file trees, AI-assisted executive briefs, and syntax-highlighted source code.
  • Intelligent Scanning: Recursive traversal with configurable filters and robust .csignore support (gitignore-style syntax).
  • Versioned Output: Automatic -v1, -v2 suffixes prevent overwriting previous reports.
  • CI/CD Ready: --no-interactive mode for automated documentation pipelines.

📦 Installation

npm install -g codesummary

Requirements: Node.js ≥ 18.0.0


🎯 Output Modes

💬 LLM — Direct Chat Context

Generate a single, token-optimized Markdown file to paste into ChatGPT, Claude, or any other LLM:

codesummary --format llm
# Output: PROJECT_llm.md

The file includes a project overview, a suggested reading order, dependency graphs, and full file contents with language hints. Lossless optimizations (normalizing line endings, stripping trailing whitespace, compacting JSON) are applied automatically.

📄 PDF — Audits & Handovers

Generate a professional A4 PDF for human consumption:

codesummary --format pdf
# Output: PROJECT_code.pdf

Best for: code reviews, client handovers, compliance audits, and physical archiving.


📖 Usage

Quick Start

# First run: Interactive setup wizard
codesummary

# Generate LLM Markdown for the current project
codesummary --format llm

# Generate both formats in one run
codesummary --format both

# Generate a task-focused context pack (prioritizes relevant files)
codesummary --format llm --focus "authentication flow" --max-tokens 12000

Interactive Workflow

  1. First-Run Setup: Detects missing configuration and launches a wizard to set your default output paths.
  2. Extension Selection: Choose which file types to include (e.g., .ts, .py, .md).
  3. Generation: Files are scanned, analyzed, and rendered to your chosen format.

Optional AI Enrichment

Enhance your reports with AI-generated architecture insights:

# Using local Ollama
codesummary --format llm --ai-semantic --provider ollama --model llama3.1

# Using an OpenAI-compatible endpoint
codesummary --format llm --ai-semantic --provider openai-compatible --api-key YOUR_KEY

Note: AI enrichment is optional. If the provider is unavailable, CodeSummary falls back to heuristic analysis.


⚙️ Configuration

Configuration is stored globally at:

  • Windows: %APPDATA%\CodeSummary\config.json
  • Linux/macOS: ~/.codesummary/config.json

Existing settings are preserved during upgrades; new defaults are merged automatically.

.csignore Support

Use a .csignore file in your project root to exclude sensitive paths (keys, tokens, private data) using standard .gitignore syntax.


🛠️ Project Structure

  • bin/codesummary.js: CLI Entry point.
  • src/cli.js: Argument parsing and flow orchestration.
  • src/scanner.js: Recursive file system traversal and filtering.
  • src/graph/: Dependency graph engine and language adapters.
  • src/llmGenerator.js: Token-optimized Markdown generation.
  • src/pdfGenerator.js: High-fidelity PDF generation (PDFKit).
  • src/configManager.js: Global configuration and migration logic.

🤝 Contributing

  1. Fork the repository.
  2. Clone: git clone https://github.com/skamoll/CodeSummary.git
  3. Install: npm install
  4. Submit a pull request.

📄 License

Distributed under the GNU General Public License v3.0. See LICENSE for details.


📊 Roadmap

  • [x] LLM-optimized Markdown output.
  • [x] Versioned output filenames.
  • [x] Deep dependency graph analysis.
  • [x] VS Code Extension (MVP).
  • [ ] Automated regression test suite.

See ROADMAP.md for detailed product direction.