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

textify-codebase

v0.3.0

Published

Generates/Applies a structured text representation of a codebase. Includes directory tree, file contents, excludes ignores, optionally scrubs secrets. Useful for LLMs.

Downloads

9

Readme

textify-codebase

textify-codebase is a CLI utility for generating a clean, shareable text snapshot of an entire repository. The output pairs a directory tree with each file's contents so that you can hand comprehensive project context to an AI assistant or archive it for review. It also ships with an apply command that can recreate a codebase from a previously generated snapshot.

Features

  • 📂 Directory tree export with configurable depth limits.
  • 📝 File content capture that respects .gitignore, built-in safe defaults, and custom ignore patterns.
  • 🛡️ Optional secret scrubbing for common key formats and credentials.
  • 🎯 New selective export controls:
    • --include to focus on glob-matched files.
    • --max-file-depth to constrain how deep the content scan travels.
    • --max-file-bytes to skip unexpectedly large artifacts.
  • 🔁 Apply mode to materialise a textified snapshot back onto disk, with dry-run and confirmation safeguards.

Installation

npm install --global textify-codebase

Or add it to an existing project:

npm install --save-dev textify-codebase

Usage

Generate a snapshot

textify-codebase [directory] [options]

Common flags:

| Flag | Description | | --- | --- | | -o, --output <file> | Write to a file instead of stdout. | | -i, --ignore <pattern...> | Append ignore rules (same format as .gitignore). | | -I, --include <pattern...> | Only include files matching the provided glob(s). | | -d, --max-depth <depth> | Maximum depth when rendering the directory tree (default 5). | | --max-file-depth <depth> | Limit how deep the file content scan traverses (default unlimited). | | --max-file-bytes <bytes> | Skip files larger than the specified size. | | --no-gitignore | Skip reading .gitignore rules. | | --no-default-ignore | Skip bundled safe-ignore defaults. | | --scrub | Enable heuristic secret scrubbing. | | --tree-only | Emit only the directory tree. | | --content-only | Emit only the file contents. |

Tip: Include patterns only influence the file content export. The directory tree remains unchanged so you maintain full context of project structure.

Apply a snapshot

textify-codebase apply <inputFile> [options]

Key flags:

| Flag | Description | | --- | --- | | -t, --target <directory> | Destination directory (defaults to current working directory). | | -y, --yes | Skip the confirmation prompt. | | --dry-run | Show the files that would be written without touching disk. | | --encoding <encoding> | Override the output encoding (default utf-8). |

Examples

Generate a focused snapshot of all JavaScript source files but skip assets larger than 200 kB:

textify-codebase src --include "**/*.js" --max-file-bytes 204800 --output snapshot.txt

Limit both the directory tree and the content scan to just two levels deep:

textify-codebase --max-depth 2 --max-file-depth 2

Dry-run the apply workflow to preview the files that would be written:

textify-codebase apply snapshot.txt --target ./restored --dry-run

Development

Install dependencies and run the automated checks:

npm install
npm run lint
npm run typecheck
npm run build

The lint script enforces a couple of lightweight hygiene rules (no trailing whitespace and files must end in a newline), the type check script runs node --check across every JavaScript entry point, and the build script performs a CLI smoke test to ensure bo th the main and apply commands can display their help text successfully.

License

MIT