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

ctxstash

v0.1.0

Published

Pack a codebase into one LLM-ready Markdown file with a file tree and token estimate. Zero dependencies, no server.

Readme

ctxstash

Pack a codebase into one LLM-ready Markdown file — with a file tree and a token estimate. Zero dependencies, no server, no telemetry.

You're feeding code to ChatGPT / Claude / Cursor and you keep doing the same dance: open file, copy, paste, label it, repeat — then guess whether it'll blow the context window. ctxstash does it in one command: walk a directory, skip the junk (node_modules, lockfiles, binaries), and emit a single tidy Markdown document with every file fenced and language-tagged, prefixed by a tree overview and an approximate token count.

npx ctxstash src > context.md
✓ packed 23 files · 142.3 KB · ~38,210 tokens

There's a matching, behavior-identical Python version: pip install ctxstash.

Install

npm install -g ctxstash     # then: ctxstash ...
# or just run it without installing:
npx ctxstash .

Requires Node ≥ 18. No dependencies.

Usage

ctxstash [paths...] [options]
ctxstash .                          # pack the current dir to stdout
ctxstash src test > context.md      # pack two dirs, redirect to a file
ctxstash . -o context.md            # ...or write the file directly
ctxstash . -i "*.ts,*.tsx"          # only TypeScript
ctxstash . -e "*.test.js,*.snap"    # drop tests and snapshots
ctxstash . --estimate               # just tell me the token cost
ctxstash src --tree                 # just the file tree

Options

| Option | Description | | --- | --- | | -o, --out <file> | Write to a file instead of stdout | | -i, --include <globs> | Only include matching files (comma-separated, e.g. "*.js,*.ts") | | -e, --exclude <globs> | Exclude matching files (comma-separated) | | --tree | Print only the file tree (no contents) | | --no-tree | Omit the file-tree overview from the packed output | | --estimate | Print only stats (files, size, ~tokens) — pack nothing | | --max-size <size> | Skip files larger than this (e.g. 256kb, 1mb; default: no limit) | | --no-default-ignore | Don't auto-skip node_modules / .git / dist / lockfiles / etc. | | --no-color | Disable colored stderr | | -h, --help · -v, --version | |

Globs support * (within a path segment), ** (across segments), and ?. A slash-less pattern like *.js matches at any depth.

What you get

# Repository context

> Packed by ctxstash — 3 files, 4.1 KB, ~1,040 tokens (estimate).

## File tree

​```
src/
  core.js
  cli.js
README.md
​```

## Files

### src/core.js

​```javascript
...file contents...
​```

The summary line always goes to stderr, so ctxstash > context.md keeps the file clean while you still see the count in your terminal.

Notes & limits

  • Binary files are skipped automatically (NUL-byte / control-byte sniff), so images and compiled artifacts never end up in your context.
  • Token counts are an estimate (~4 characters per token, OpenAI's rule of thumb) — tokenizer-agnostic and good enough for "will this fit?", not exact billing. For precise counts, run the output through a real tokenizer.
  • Fences are collision-safe: if a file contains a ``` run, ctxstash wraps it in a longer fence so the Markdown stays valid.
  • Symlinks are not followed (avoids loops).

License

MIT