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

repo-text

v2.0.0

Published

The lightest LLM context packer. Pack your entire repo into a single AI-ready file. 100x smaller than repomix, zero bloat.

Readme

repo-text ⚡

The lightest LLM context packer. Pack your entire codebase into a single AI-ready file — XML, Markdown, or Plain Text.

100x smaller than repomix. Zero bloat. Instant startup.

npx repo-text

Why repo-text?

| | repo-text | repomix | |---|---|---| | 📦 Package Size | ~6 KB | 604 KB | | 🔗 Dependencies | 1 | 27+ | | 💾 Install Size | ~150 KB | ~50+ MB | | ⚡ Startup Time | ~50ms | ~500ms+ | | 🧠 Output Formats | XML, Markdown, Plain | XML, Markdown, JSON, Plain | | 🌳 Directory Tree | ✅ | ✅ | | 🗜️ Compression | ✅ (regex-based) | ✅ (tree-sitter) | | 📋 Clipboard Copy | ✅ (native) | ✅ | | 🔒 Secret Detection | ✅ (built-in) | ✅ (secretlint) | | 🔢 Token Counting | ✅ (BPE approx) | ✅ (gpt-tokenizer) | | 📁 Binary Detection | ✅ | ✅ | | ⚙️ Config File | ✅ | ✅ | | 🔍 Include/Exclude | ✅ | ✅ |

Same features. 100x lighter.


Installation

# Use directly with npx (recommended)
npx repo-text

# Or install globally
npm install -g repo-text

Quick Start

# Pack current directory (plain text)
repo-text

# XML format with directory tree
repo-text --style xml --tree

# Markdown with compression (strips function bodies)
repo-text --style markdown --compress

# Copy to clipboard
repo-text --copy

# Only include source files
repo-text --include "src/**" --include "lib/**"

# Exclude tests
repo-text --exclude "**/*.test.js" --exclude "**/*.spec.ts"

Output Formats

Plain Text (default)

================================================================
Project: my-app
Generated by: repo-text v2.0.0
================================================================

════════════════════════════════════════════════════════════════
File: src/index.js
════════════════════════════════════════════════════════════════
const app = express();
...

XML (--style xml)

<?xml version="1.0" encoding="UTF-8"?>
<repository>
  <metadata>
    <name>my-app</name>
    <generator>repo-text v2.0.0</generator>
  </metadata>
  <files>
    <file path="src/index.js" language="javascript">
      <content><![CDATA[const app = express();]]></content>
    </file>
  </files>
</repository>

Markdown (--style markdown)

# my-app

> Generated by **repo-text** v2.0.0

## Files

### `src/index.js`

```javascript
const app = express();
```

CLI Reference

Usage:
  repo-text [options] [output-file]
  flatter [options] [output-file]
  flatten [options] [output-file]

Output:
  -o, --output <file>     Output file path (default: repo-text-output.<style>)
  -s, --style <format>    Output format: plain, xml, markdown (default: plain)
  --tree                  Include directory tree at the top
  --line-numbers          Add line numbers to file contents
  --compress              Strip function bodies, keep signatures (~50% smaller)
  --no-comments           Remove code comments from output

Filtering:
  --include <glob>        Only include files matching pattern (repeatable)
  --exclude <glob>        Exclude files matching pattern (repeatable)
  --max-size <KB>         Skip files larger than N KB (default: 500)

Extras:
  -c, --copy              Copy output to clipboard
  --no-tokens             Hide token count
  --no-security-check     Skip secret detection scan
  --config <path>         Path to config file
  --verbose               Show skipped files and detailed stats

Info:
  -v, --version           Show version
  -h, --help              Show this help

Config File

Create repo-text.config.json in your project root:

{
  "style": "xml",
  "tree": true,
  "compress": false,
  "copy": false,
  "lineNumbers": false,
  "noComments": false,
  "maxSize": 500,
  "include": ["src/**", "lib/**"],
  "exclude": ["**/*.test.js", "**/__mocks__/**"]
}

All CLI flags override config file values.

Smart Defaults

repo-text automatically:

  • ✅ Respects .gitignore
  • ✅ Skips binary files (images, videos, archives, fonts, etc.)
  • ✅ Skips lock files (package-lock.json, yarn.lock, etc.)
  • ✅ Skips build folders (dist, build, .next, etc.)
  • ✅ Skips dependency folders (node_modules, vendor, venv, etc.)
  • ✅ Skips files larger than 500KB (configurable)
  • ✅ Scans for accidentally committed secrets
  • ✅ Strips trailing whitespace and collapses blank lines

Compression (--compress)

The --compress flag uses regex-based analysis to strip function and method bodies while keeping signatures, imports, and type declarations. This reduces token usage by ~50% while preserving the structural context that LLMs need.

Supported languages: JavaScript, TypeScript, Python, Go, Rust, Java, Kotlin, C#, Dart

# Normal output: ~10,000 tokens
repo-text --style xml

# Compressed output: ~5,000 tokens
repo-text --style xml --compress

Security Scanning

repo-text automatically scans for common secrets and warns you before they end up in your LLM context:

  • AWS Access Keys & Secret Keys
  • GitHub/GitLab Personal Access Tokens
  • Slack Tokens
  • Private Keys (RSA, EC, DSA)
  • API Keys and Secrets
  • Database Connection Strings
  • Stripe Keys
  • Google API Keys
  • JWTs

Suppress with --no-security-check.

Aliases

repo-text registers three commands for convenience:

repo-text    # primary
flatter      # short
flatten      # alternative

Contributing

Issues and PRs welcome at github.com/Elayaraman/repo-text.

License

MIT © Elayaraman