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 🙏

© 2025 – Pkg Stats / Ryan Hefner

treecat

v1.0.2

Published

View folder structure like tree and display file contents like cat — all in one CLI.

Readme

treecat - Interactive Directory Structure and Content Scanner

License Version

treecat is a powerful CLI tool that combines directory tree visualization with file content preview capabilities. It works in both interactive and non-interactive modes, perfect for developers who need to quickly explore project structures or document codebases.

Features

  • Interactive & Non-interactive Modes: Choose between guided prompts or CLI arguments
  • Smart Filtering:
    • Filter by file extensions (.js, .md, etc.)
    • Match filename patterns (*.spec.js, test-*.ts)
    • Respect .gitignore rules
  • Content Inspection:
    • Highlight keywords in file contents
    • Preview files directly in terminal
  • Multiple Output Formats:
    • Terminal display with syntax highlighting
    • Export to TXT, Markdown, JSON, and HTML
    • Generate ZIP archives of scanned files
  • Configuration:
    • Save and reuse scan configurations
    • Customizable file size limits
  • Performance Tracking:
    • Scan statistics and timing
    • Error logging for unreadable files

Installation

Using npm (global installation)

npm install -g treecat

Using yarn

yarn global add treecat

From source

git clone https://github.com/nzingx/treecat.git
cd treecat
npm install
npm link

Usage

Interactive Mode (default)

treecat

Follow the interactive prompts to configure your scan.

Non-interactive Mode

treecat --path ./src --ext .js,.jsx --keyword TODO --output md

Common Options

| Option | Description | |--------|-------------| | -p, --path <dir> | Target directory to scan | | -e, --ext <extensions> | Comma-separated file extensions | | --pattern <patterns> | Filename patterns (glob) | | -k, --keyword <text> | Highlight keyword in contents | | -o, --output <format> | Output format (txt, md, json, html) | | --exclude-gitignore | Respect .gitignore rules (default: true) | | --save-config | Save current settings | | -c, --config <path> | Load config from file |

Info Commands

treecat --version       # Show version
treecat --license       # Show license
treecat --docs          # Open documentation
treecat --issues        # View issue tracker

Configuration

Example .treecatrc.json:

{
  "version": "1.0.1",
  "targetDir": "./src",
  "excludeGitignore": true,
  "extensions": [".js", ".jsx"],
  "patterns": ["*"],
  "keyword": "TODO",
  "outputChoice": "md",
  "maxFileSize": 1048576,
  "encoding": "utf-8"
}

Sample Output

Directory Tree

project/
 src/
    index.js
    utils/
        helper.js
 tests/
     index.spec.js

File Content Preview

# File: src/index.js
--------------------
import React from 'react';
// TODO: Add error boundary
const App = () => {...};

Project Structure

treecat/
├── bin
│   └── treecat.mjs
├── lib
│   ├── clearLine.js
│   ├── collectMatchedFiles.js
│   ├── constants.js
│   ├── createArchive.js
│   ├── deps.js
│   ├── errors.js
│   ├── executeScan.js
│   ├── formatBytes.js
│   ├── generateFileTree.js
│   ├── getTimestamp.js
│   ├── help.js
│   ├── loadConfig.js
│   ├── main.js
│   ├── outputHandler.js
│   ├── parseArguments.js
│   ├── processFileContents.js
│   ├── promptForOptions.js
│   ├── readGitignore.js
│   ├── renderTree.js
│   ├── safeReadFile.js
│   ├── saveConfig.js
│   └── state.js
├── LICENSE
├── package.json
└── README.md

License

This project is licensed under the EVL License. See LICENSE for details.

Support

Found a bug or have a feature request? Please open an issue.


Developed with by nzingx