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

codebase-flattener

v0.1.1

Published

Flatten a codebase into one file for LLM ingestion

Readme

codebase-flattener

Flatten a codebase into a single file for easy LLM ingestion.


Features:

  • Recursively walk your project, respecting .gitignore, .llmignore, and custom ignore rules.
  • Skip the output file itself to avoid self-inclusion.
  • Follow or ignore symlinks via a flag.
  • Overridable output filename (default: codebase.txt).

📦 Installation

From Rust (crates.io)

Ensure you have Rust and Cargo installed (edition 2021+):

# Install from crates.io\ ncargo install codebase-flattener

Or build locally:

git clone https://github.com/szczuroskoczek/codebase-flattener.git
cd codebase-flattener
cargo build --release
# The binary will be in target/release/

From npm

You can also install via npm to use the published JavaScript CLI wrapper:

# Install globally
npm install -g codebase-flattener

# Or use npx without global install
npx codebase-flattener

🚀 Usage

Once installed (via Rust or npm), simply run:

codebase-flattener

Or with any combination of options:

# Add custom ignore files
codebase-flattener --ignore extra.ignore --ignore temp.ignore

# Disable all default ignore files
codebase-flattener --no-default-ignores --ignore only.ignore

# Don’t follow symlinks
codebase-flattener --no-follow

# Change the output filename
codebase-flattener --output project_dump.txt

All files are dumped into codebase.txt with separators:

<<< FILE: path/to/file.ext >>>
<file contents>

⚙️ Command-line Options

| Option | Description | | ------------------------- | ------------------------------------------------------------ | | -i, --ignore <FILE> | Append a custom ignore filename (can be used multiple times) | | --no-default-ignores | Disable default .gitignore & .llmignore loading | | -n, --no-follow | Don’t follow symbolic links | | -o, --output <FILENAME> | Set the output file name (default: codebase.txt) | | -h, --help | Print help information | | -V, --version | Print version info |


🤝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/foo)
  3. Commit your changes (git commit -am "Add foo")
  4. Push to the branch (git push origin feature/foo)
  5. Open a pull request

We welcome improvements, bug fixes, and enhanced documentation!


📝 License

Licensed under MIT. See LICENSE for details.


Created by Krystian Mikołajczyk | Crates.io | npm | GitHub