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

repo2doc

v0.1.3

Published

Generate text/markdown repository snapshots for LLM context ingestion

Readme

repo2doc

repo2doc is a Rust command-line tool that converts repository files into LLM-friendly document snapshots.

What It Generates

  • Deterministic output files (repo2doc_001.txt, repo2doc_002.txt, ...)
  • First document includes repository metadata and an ASCII directory tree
  • One section per source file (a source file is never split across outputs)
  • Optional zip archive containing all generated output files

The scanner respects .gitignore, hard-excludes .git internals and .env* paths, skips binary files, and can optionally narrow output with include globs.

Install

Cargo (Local)

cargo install --path . --locked
repo2doc --help

npm (After Publishing)

This npm package builds the Rust binary during install, so Rust (cargo) must be available on the machine. The published lockfile is pinned to avoid edition2024-only transitive crates, so installs work on Cargo 1.83.0+.

npm install -g repo2doc
repo2doc --help

Build and Run

cargo build --release
cargo run --

CLI Usage

repo2doc [OPTIONS]

Key options:

  • --repo <PATH>: repository root to scan (default: .)
    • when omitted (or .), repo2doc auto-detects the git top-level for the current working directory
    • if no git repo is detected, it uses the current working directory
  • --out <PATH>: output directory (default: ./repo_docs)
  • --max-words-per-file <WORDS>: word limit per output file (default: 500k = 500,000 words)
    • supports k and m suffixes (120k, 1m)
    • 0 means no limit (single output file)
  • --format <txt|md>: output format (default: txt, markdown is optional backup)
  • --include <GLOB>: only render files matching one or more globs
    • repeat the flag to combine patterns with OR semantics
    • patterns without / match basenames anywhere in the repo (pattern*.rs)
    • patterns with / match repo-relative paths (src/**/*.rs)
  • --zip-out <ZIP_PATH>: optional zip destination
  • --staged: only document files currently staged in git (writes staged.<ext>)
  • --commit <COMMIT>: only document files touched by one or more commits (repeatable)
    • output file name uses the first commit value: <first-commit>.<ext>
  • --diff: with --staged or --commit, render git patch output instead of full file contents
    • output file stem adds _diff in this mode (staged_diff.<ext>, <first-commit>_diff.<ext>)
    • git-scoped modes require --repo to point at a git work tree

Examples

# default behavior (txt output, 500k words per file)
repo2doc

# custom word limit
repo2doc --max-words-per-file 120k

# no limit (single file)
repo2doc --max-words-per-file 0

# markdown output
repo2doc --format md

# only include Rust files whose basenames start with "pattern"
repo2doc --include 'pattern*.rs'

# only include repo-relative paths under src/
repo2doc --include 'src/**/*.rs'

# zip output
repo2doc --zip-out ./repo_docs/output.zip

# only staged files, full file contents (default mode for scoped generation)
repo2doc --staged

# only staged changes as patch output
repo2doc --staged --diff

# files touched by one commit
repo2doc --commit 8e92f6d

# files touched by multiple commits (output named after the first commit)
repo2doc --commit 8e92f6d --commit 7a3fdcb

# commit-scoped patch output
repo2doc --commit 8e92f6d --diff

Quality Gates

cargo fmt --all
cargo clippy --all-targets --all-features -- -D warnings -D missing_docs -D clippy::missing_errors_doc
cargo test