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

treezip

v1.0.0

Published

Compressed tree output for AI-optimized codebase summaries

Readme

treezip

Compressed directory trees for AI prompts. Zero dependencies.

tree output is verbose — treezip compresses it using brace grouping, directory collapsing, and truncation so you can fit more codebase structure into fewer tokens.

Install

npm install -g treezip

Or run directly:

npx treezip ./my-project

Before / After

tree (43 lines):

my-project/
├── docs
│   ├── api-reference.md
│   ├── contributing.md
│   └── getting-started.md
├── package.json
├── public
│   └── images
│       ├── avatar.png
│       ├── background.png
│       ├── badge.png
│       ├── banner.png
│       ├── feature.png
│       ├── hero.png
│       ├── icon.png
│       ├── logo.png
│       ├── pattern.png
│       ├── placeholder.png
│       └── screenshot.png
├── README.md
├── src
│   ├── App.tsx
│   ├── components
│   │   ├── Button.tsx
│   │   ├── Card.tsx
│   │   ├── Header.tsx
│   │   ├── Modal.tsx
│   │   └── Sidebar.tsx
│   ├── hooks
│   │   ├── useApi.ts
│   │   ├── useAuth.ts
│   │   └── useTheme.ts
│   ├── index.ts
│   └── utils
│       ├── api.ts
│       ├── auth.ts
│       ├── format.ts
│       └── validate.ts
├── tests
│   ├── Button.test.tsx
│   ├── Card.test.tsx
│   ├── Header.test.tsx
│   ├── Modal.test.tsx
│   ├── setup.ts
│   └── Sidebar.test.tsx
└── tsconfig.json

treezip (17 lines):

my-project/
├── {.gitignore,README.md,package.json,tsconfig.json}
├── docs/{api-reference,contributing,getting-started}.md
├── public/images/{avatar,background,badge,banner,feature,...}.png
├── src/
│   ├── {App.tsx,index.ts}
│   ├── components/{Button,Card,Header,Modal,Sidebar}.tsx
│   ├── hooks/{useApi,useAuth,useTheme}.ts
│   └── utils/{api,auth,format,validate}.ts
└── tests/
    ├── setup.ts
    └── {Button,Card,Header,Modal,Sidebar}.test.tsx

60% fewer lines. Same information. Every brace group decompresses to exactly one file per entry.

How it works

| Pattern | Meaning | Example | |---|---|---| | {a,b,c}.ext | Siblings sharing an extension | {Button,Card,Modal}.tsx | | {a.x,b.y} | Siblings with different extensions | {README.md,tsconfig.json} | | dir/{stems}.ext | All files in dir share an extension | utils/{api,auth,format}.ts | | dir/file | Single-child directory collapsed | scripts/build.sh | | {a,b,...}.ext | Truncated group (more files exist) | images/{logo,hero,...}.png |

Compression rules

  1. Mixed directories (files + subdirs): all files grouped into one {...} set
  2. Files-only directories: grouped by shared extension (compound-aware: .test.ts, .config.js)
  3. Inline collapse: directories that compress to a single item shown inline
  4. Single-child chain: a/b/c.txt when each level has one child
  5. Truncation: groups with >8 items show the first 5 + ...

Default ignores

node_modules, .git, .DS_Store, __pycache__, .pnpm

Output header

Every output includes a self-documenting header:

# COMPRESSED FILE TREE — AI READ GUIDE
# {a,b,c}.ext  → siblings sharing extension   | scripts/f.js → collapsed single-child dir
# {...}.ext     → truncated list (more exist)  | decompress: expand braces × each entry = 1 path

This lets LLMs interpret the format without extra instructions.

Programmatic API

import { scan, compress, render, countNodes } from "treezip";

const tree = scan("./my-project");
const compressed = compress(tree);
const { dirs, files } = countNodes(tree);
const output = render("my-project/", compressed);
console.log(output);

License

MIT