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

@krizic/repo-context

v0.1.1

Published

Generate a single context.md snapshot of your repository (overview, file tree, and file contents) to feed to LLM coding agents.

Readme

📦 repo-context

Turn your entire repository into one clean Markdown file your AI coding agent can actually read.

Stop copy-pasting files into ChatGPT one at a time. repo-context scans your repo, respects your .gitignore, and writes a single context.md with an overview, a directory tree, and the full contents of every relevant file — ready to paste into Claude, ChatGPT, Cursor, Copilot, or any LLM that needs to understand your project fast.

npm version CI License: MIT

✨ Why you'll like it

  • Zero config, sensible defaults — just run it, it figures out what matters.
  • Git-aware — uses git ls-files under the hood so anything in .gitignore is automatically skipped.
  • Monorepo friendly — picks up every package.json in the tree for a quick multi-package overview.
  • Binary-safe — skips images, fonts, archives, and lockfiles instead of dumping garbage into your context window.
  • Budget aware — caps individual file size and total embedded size so you don't blow your model's context window.
  • Fast — plain Node.js, no heavy dependencies, runs in milliseconds on most repos.

🚀 Quick start

Run it once, no install required:

npx @krizic/repo-context

That's it — you now have a context.md in your project root. Drop it into your favorite AI chat and start asking questions about your codebase.

📥 Install

npm install --save-dev @krizic/repo-context
# or
pnpm add -D @krizic/repo-context
# or
yarn add -D @krizic/repo-context

🛠️ Add it to your project's scripts

The nicest way to use repo-context is to wire it into package.json so your whole team (and every agent) can run it the same way:

{
  "scripts": {
    "context": "repo-context",

    // override the defaults to fit your project
    "context:full": "repo-context --out docs/context.md --max-bytes 200000 --max-total-bytes 20000000",

    // just want the shape of the repo, no file contents?
    "context:tree": "repo-context --tree-only --out docs/tree.md"
  }
}

Then simply run:

npm run context

⚙️ CLI options

| Flag | Default | Description | |---|---|---| | --out <path> | context.md | Where to write the generated file (relative to --root). | | --root <path> | current directory | Repository root to scan. | | --max-bytes <n> | 100000 | Max size (bytes) of a single file's content to embed. Larger files are listed but skipped. | | --max-total-bytes <n> | 5000000 | Total size (bytes) budget for all embedded file contents combined. | | --tree-only | false | Only emit the overview + directory tree, skip embedding file contents entirely. |

README.md, AGENTS.md, AGENT.md, CONTRIBUTING.md, and ARCHITECTURE.md are always embedded in full, regardless of size limits, since they're usually the most useful context for an agent.

🧑‍💻 Use it as a library

Prefer to script it yourself? repo-context exports its core function too:

import { generateContext } from '@krizic/repo-context'

const result = await generateContext({
  root: process.cwd(),
  out: 'CONTEXT.md',
  maxFileBytes: 50_000
})

console.log(result.stats)

📄 What you get

# Repository Context: my-app

_Generated: 2026-07-24T10:00:00.000Z_

## Overview
- **my-app** (package.json) — v1.0.0
  - scripts: build, dev, test

## Directory Structure
├── src/
│   ├── index.ts
│   └── utils.ts
└── package.json

## File Contents
### src/index.ts
​```ts
...
​```

## Stats
- Files listed: 42
- Files embedded: 38 (210.4 KB)
- Skipped (binary): 3
- Skipped (over --max-bytes): 1

🤝 Contributing

Issues and PRs are very welcome! This is a small, focused tool — the best contributions keep it that way.

git clone https://github.com/krizic/repo-context.git
cd repo-context
npm install
npm run build
npm test

📜 License

MIT © Vedran Krizic