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

@vetterjulius/cagg

v1.0.0

Published

Code Aggregator - bundles all text/code files of a repository into a single .txt file, with gitignore-aware filtering

Readme

cagg — Code Aggregator

Bundles every relevant text/code file of a repository into a single output file, each preceded by a clear header showing which file follows:

-------------- src/index.js -----------------
1: 'use strict';
2:
...

Built for feeding a codebase to an LLM or for a quick, readable overview of a project — the output is kept as small as possible (no unnecessary blank lines, no binaries, no build artifacts).

Example

An example aggregation of the source code for the tool is included. See agg.txt.

Install

npm install -g cagg

Usage

cagg                       # aggregate CWD into ./agg.txt
cagg -i path/to/project     # aggregate a different folder
cagg -o context.md          # change output name/extension
cagg -a                     # use absolute paths in headers instead of CWD-relative
cagg --no-line-numbers      # don't prefix lines with numbers
cagg --max-size 1           # skip files larger than 1 MB
cagg --max-lines 2000       # skip files with more than 2000 lines

Ignoring files

By default, cagg ignores an extensive built-in list of common clutter: .git, node_modules, build/dist output, caches, lockfiles, IDE folders, OS files, and common binary/media file types (images, fonts, archives, documents, ...). Files that don't look like text (checked by content, not just extension) are always skipped and reported.

  • --no-ignore — disable all ignoring; every file is included. Prints a warning since this will likely pull in dependencies and binaries.
  • --ignore-patterns "pattern1,pattern2" — supply your own .gitignore-style patterns. This replaces the built-in default list. Can be repeated / combined with commas.
  • --ignore-file <path> — same idea, but patterns come from a file (e.g. point it at your real .gitignore). Also replaces the default list.
  • If the current directory has a .gitignore, its entries are automatically merged into whichever ignore list is active (default or custom). Disable this with --no-merge-gitignore.

The output file itself is always excluded from its own aggregation.

All options

-i, --input <path>            input directory to scan (relative to CWD or absolute) (default: ".")
-o, --output <path>           output file name/path (default: "agg.txt")
-a, --absolute-paths          use absolute paths in file headers instead of CWD-relative paths
    --no-ignore                disable all ignoring; include every file (prints a warning)
    --ignore-patterns <patterns>  comma-separated gitignore-style patterns, replaces default ignore list
    --ignore-file <path>       file with gitignore-style patterns, replaces default ignore list
    --no-merge-gitignore       don't merge a CWD .gitignore into the active ignore list
    --no-line-numbers          do not prefix each line with its line number
    --max-size <mb>            skip files larger than this size in MB
    --max-lines <n>            skip files with more lines than this
-h, --help                     display help
-V, --version                  output the version number