@abdo9616/printprojecttree
v2.0.1
Published
A tool to print the structure of a project in a tree format.
Readme
Project Tree
Small CLI to print directory structures in tree format.
Install
npm install
npm linkAfter linking, these commands are available:
project-tree
ptreeQuick Usage
# Interactive mode
project-tree
# Print any directory (relative or absolute)
project-tree ../another-folder
ptree "C:/Users/you/Documents/project"
# Multiple targets
project-tree ./src ./tests
# Comma-separated targets (compatibility)
project-tree --paths "./src,./tests"
# One-time excludes
project-tree . --exclude "dist,coverage"
# Include node_modules/.git too
project-tree . --no-default-ignoresSaved Excludes (JSON Config)
Saved excludes are stored in your user config directory by default:
- Windows:
%APPDATA%\\project-tree\\config.json - Linux/macOS (XDG):
$XDG_CONFIG_HOME/project-tree/config.json - Linux/macOS (fallback):
~/.config/project-tree/config.json
Example config:
{
"savedExcludes": ["dist", "coverage"]
}Manage saved excludes:
project-tree --add-saved-excludes "dist,coverage"
project-tree --remove-saved-excludes "coverage"
project-tree --set-saved-excludes "dist,build"
project-tree --clear-saved-excludes
project-tree --list-saved-excludesUse a custom config location:
project-tree --config "./config/tree.json" --list-saved-excludesIf you prefer project-local config:
project-tree --config ".project-tree.json" --add-saved-excludes "dist,coverage"Behavior Summary
- Default ignores are enabled:
node_modules,.git. - Final excludes are merged from:
- Default ignores (unless
--no-default-ignores) - Saved excludes from config
- One-time excludes from
--exclude
- Default ignores (unless
