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

project-tree-md

v3.3.3

Published

Enterprise codebase intelligence, directory tree generator & 2D/3D code visualizer suite. Generates interactive Code Relationship Graphs, Mind Maps, Markdown, JSON, HTML, SVG, Mermaid, and ZIP bundles. Zero dependencies. Node.js 20+.

Downloads

2,211

Readme


🔥 Key Features & Capabilities

  • 🌐 Interactive 2D & 3D Code Graph: Explore codebase imports, exports, and module relationships with 3D WebGL spatial sphere and flat 2D canvas (ptree --visualize).
  • 🧠 Interactive Horizontal Mind Map: Auto-layout node hierarchy with curved Bezier connectors, pan/zoom, and live JSON data editor (ptree --mindmap).
  • 📁 Dedicated Output File Names: Every command writes to its own task-specific file to prevent overwriting (GIT_STATUS_TREE.md, CHANGED_FILES_TREE.md, SORTED_TREE.md, PROJECT_DUPLICATES.md, DEPTH_TREE.md, etc.).
  • 🌿 Git Integration & Changed Files Filter: Highlight modified, added, and untracked files ([Modified], [Added], [Untracked]) or filter tree to changed files only (ptree --git-status, ptree --changed-only).
  • 🔍 Duplicate File Analyzer: Detect and report duplicate files across the repository (ptree --duplicates).
  • 📏 Lines of Code & File Size Details: Inspect line counts, byte sizes, permissions, and OS owner for every file (ptree --details, ptree --permissions, ptree --owner).
  • 📦 ZIP Bundle Generator & Multi-Format Exporter: Package all visual and structured reports into a single ZIP archive (ptree --bundle).
  • Zero Dependencies: 100% pure Node.js standard library with lightning-fast execution.

🚀 Quick Start (No Install Required)

Run directly in any project directory with npx:

| Feature / Command | Command | Dedicated Output File | | :--- | :--- | :--- | | 📄 Markdown Tree (Default) | npx ptree | PROJECT_STRUCTURE.md | | 🌐 2D/3D Code Relationship Graph | npx ptree --visualize | CODE_GRAPH.html (auto-opens) | | 🧠 Interactive Mind Map | npx ptree --mindmap | PROJECT_MINDMAP.html (auto-opens) | | 📏 Lines of Code & File Size | npx ptree --details | FORMATTED_TREE.md | | 🌿 Git Status Badges | npx ptree --git-status | GIT_STATUS_TREE.md | | 🔄 Changed Files Only | npx ptree --changed-only | CHANGED_FILES_TREE.md | | 📋 Duplicate File Finder | npx ptree --duplicates | PROJECT_DUPLICATES.md | | 🔀 Sorted Tree | npx ptree --sort size | SORTED_TREE.md | | 🏷️ File Attributes | npx ptree --modified --permissions | FILE_ATTRIBUTES.md | | 📊 Terminal Analytics Dashboard | npx ptree --dashboard | (Terminal Stdout Report) | | 📦 ZIP Package Bundle | npx ptree --bundle | project-analysis.zip |


🌐 2D & 3D Code Architecture Graph (--visualize)

Transform any codebase into dynamic, interactive 2D canvas & 3D WebGL graphs showing complete architecture, dependency graphs, state flows, hooks, models, and service relationships:

npx ptree --visualize

🧠 Interactive Horizontal Mind Map (--mindmap)

Transform your codebase into a clean, horizontal node-based interactive Mind Map (PROJECT_MINDMAP.html) with Bezier line connectors and live node editing:

npx ptree --mindmap

📁 Dedicated Task Outputs & Export System

Every option flag automatically outputs to a dedicated unique filename to ensure your reports never overwrite each other:

# Line counts and file sizes
npx ptree --details            # -> FORMATTED_TREE.md

# Git status badges
npx ptree --git-status         # -> GIT_STATUS_TREE.md

# Filter to changed files only
npx ptree --changed-only       # -> CHANGED_FILES_TREE.md

# Duplicate files analysis
npx ptree --duplicates         # -> PROJECT_DUPLICATES.md

# Depth limit tree
npx ptree --depth 2            # -> DEPTH_TREE.md

# Custom exclude pattern
npx ptree --exclude "assets"   # -> FILTERED_TREE.md

📊 Competitor Comparison Matrix

| Capability / Feature | project-tree-md | tree-cli | tree-node-cli | OS tree | | :--- | :---: | :---: | :---: | :---: | | Zero External Dependencies | ✅ 0 Dependencies | ❌ 10+ Dependencies | ❌ Multiple | ⚠️ OS Dependent | | 2D / 3D WebGL Code Graph | ✅ Yes (--visualize) | ❌ No | ❌ No | ❌ No | | Interactive Bezier Mind Map | ✅ Yes (--mindmap) | ❌ No | ❌ No | ❌ No | | Multi-Format Export (JSON, SVG, ZIP)| ✅ 9+ Formats | ❌ Text Only | ❌ Text Only | ❌ Text Only | | Duplicate File Detection | ✅ Yes (--duplicates) | ❌ No | ❌ No | ❌ No | | Git Status Badges (--git-status)| ✅ Built-in | ❌ No | ❌ No | ❌ No | | Dedicated Output Filenames | ✅ No Overwriting | ❌ Overwrites | ❌ Overwrites | ❌ Overwrites | | Execution Speed (10k files) | ⚡ < 500ms | 🐢 ~1.8s | 🐢 ~1.5s | ⚡ ~600ms |


❓ Frequently Asked Questions (FAQ)

Simply open your terminal in your project directory and run:

npx project-tree-md

This scans your project and generates a clean, GitHub-ready PROJECT_STRUCTURE.md file formatted with emoji or unicode tree connectors and file stats.

Run:

npx ptree --duplicates

This inspects files across your workspace and exports a clean deduplication summary to PROJECT_DUPLICATES.md.

Unlike the standard operating system tree utility, project-tree-md requires zero system-level installation, automatically respects .gitignore and sensitive file lists, provides 2D/3D WebGL code relationship visualizers, interactive mind maps, Git status indicators, and outputs to dedicated Markdown, JSON, SVG, and HTML files.

Run:

npx ptree --visualize

This automatically parses your import/export dependency graph and opens CODE_GRAPH.html in your default browser featuring 2D Canvas force-directed layouts and 3D WebGL spatial sphere representations.

No! project-tree-md has zero third-party npm dependencies and uses 100% pure Node.js standard libraries. You can run it instantly using npx project-tree-md or npx ptree without installing anything globally.


⚙️ Configuration File (project-tree.config.json)

Customize behavior globally or per-project using a project-tree.config.json file in your root folder:

{
  "theme": "emoji",
  "details": true,
  "respectIgnore": true,
  "exclude": "dist|build|coverage",
  "maxDepth": 5
}

💻 Programmatic API

Use project-tree-md inside your Node.js scripts and workflows:

const { generateTree, scan, computeStats, generateUniversalGraph, toMindmapHtml } = require('project-tree-md');

// Generate complete project markdown
const result = generateTree({
  rootDir: process.cwd(),
  details: true,
  theme: 'emoji'
});

console.log(result.markdown);

📄 License

Distributed under the MIT License. See LICENSE for more details.