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

@jigneshdpanchal/project-tree

v1.0.3

Published

Generate a clean directory tree for any Node.js project

Downloads

148

Readme

project-tree 🌳

npm version Downloads License

A simple and fast CLI tool to generate a clean directory tree for any Node.js project.
It automatically ignores common folders like node_modules, .git, build outputs, and more.

Perfect for:

  • Project documentation
  • README files
  • Code reviews
  • Understanding unfamiliar codebases

✨ Features

  • 📂 Works with any project structure (frontend, backend, monorepo)
  • 🚫 Ignores common clutter (node_modules, .git, dist, etc.)
  • ⚡ Fast and dependency-free
  • 🖥 Cross-platform (Windows, macOS, Linux)
  • 📄 Clean, readable tree output

📦 Installation

Option 1: Use without installing (recommended)

npx project-tree

Option 2: Install globally

npm install -g project-tree

🚀 Usage

  1. Generate tree for current directory
project-tree
  1. Generate tree for a specific folder
project-tree src
project-tree backend

Example output

project-tree
├── bin
│   └── project-tree.js
├── package.json
└── README.md

🚫 Ignored by Default

The following files and folders are ignored automatically:

  • node_modules
  • .git
  • .next
  • dist
  • build
  • coverage
  • .env
  • .DS_Store
  • Lock files (package-lock.json, yarn.lock, pnpm-lock.yaml)

This keeps the output clean and readable.

⚙ CLI Options

| Option | Description | | ------------------------ | ------------------------------------------ | | --help, -h | Show this help message | | --depth <number> | Limit tree output to a specific depth | | --ignore <file/folder> | Ignore additional files or folders | | --json` | Output tree as JSON (useful for scripting) |

Examples:


# Show help
project-tree --help

# Limit depth to 2 levels
project-tree src --depth 2

# Ignore additional folder
project-tree --ignore logs

# Output JSON
project-tree backend --json

🧰 Requirements

Node.js v14 or higher

🛠 Development (Local Testing)

  1. Clone the repo and link it locally:

git clone https://github.com/jigneshdpanchal/project-tree.git
cd project-tree
npm install
npm link
  1. Run anywhere:
project-tree

📌 Use cases

  • Add project structure to README
  • Quickly inspect backend projects
  • Share folder layout in documentation
  • Understand large repositories faster

🤝 Contributing

Contributions are welcome!

  1. Fork the repository

  2. Clone your fork:


git clone https://github.com/jigneshdpanchal/project-tree.git
cd project-tree
  1. Install dependencies:

npm install
  1. Link locally for testing:

npm link
  1. Make your changes and test:
project-tree
  1. Commit, push, and create a pull request

Coding Guidelines:

  • Use CommonJS modules (require)
  • Keep no unnecessary dependencies
  • Maintain cross-platform compatibility
  • Write clear and descriptive commit messages

📄 License

ISC License

⭐ Support

If you find this useful, consider starring the project ⭐ Happy coding! 🚀


This version:

  • Adds badges for npm version, downloads, and license
  • Adds CLI options section with examples
  • Fixes spacing and markdown formatting
  • Keeps installation, usage, ignored files, and requirements clear
  • Adds structured contributing guide