@jigneshdpanchal/project-tree
v1.0.3
Published
Generate a clean directory tree for any Node.js project
Downloads
148
Maintainers
Readme
project-tree 🌳
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
- Generate tree for current directory
project-tree
- 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)
- Clone the repo and link it locally:
git clone https://github.com/jigneshdpanchal/project-tree.git
cd project-tree
npm install
npm link
- 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!
Fork the repository
Clone your fork:
git clone https://github.com/jigneshdpanchal/project-tree.git
cd project-tree
- Install dependencies:
npm install
- Link locally for testing:
npm link
- Make your changes and test:
project-tree
- 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
