A CLI tool to generate folder structure tree documentation just from typing folder-tree in your terminal
npm install document-it-clibash
npm install -g document-it-cli
`
$3
`bash
git clone
cd document-it-cli
npm install
npm run build
npm link
`
Usage
Navigate to any directory and run:
`bash
document_it
`
This will create a STRUCTURE.md file in the current directory with the folder tree.
$3
`bash
document_it [options]
`
Options:
- -o, --output - Specify output file (default: STRUCTURE.md)
- -d, --depth - Maximum depth to traverse
- -i, --ignore - Additional patterns to ignore
- -H, --show-hidden - Show hidden files and folders
- -p, --print - Print to console instead of file
- -h, --help - Display help
- -V, --version - Display version
$3
Basic usage:
`bash
document_it
`
Custom output file:
`bash
document_it -o docs/structure.txt
`
Limit depth to 3 levels:
`bash
document_it -d 3
`
Print to console:
`bash
document_it -p
`
Ignore additional patterns:
`bash
document_it -i "*.log" "temp" "cache"
`
Show hidden files:
`bash
document_it -H
`
Combine options:
`bash
document_it -o PROJECT_STRUCTURE.md -d 4 -i "*.test.js"
`
Default Ignored Patterns
The tool automatically ignores:
- node_modules
- .git
- dist
- build
- .next
- coverage
- .DS_Store
- .env
Example Output
`
my-project/
├── src/
│ ├── components/
│ │ ├── Header.tsx
│ │ └── Footer.tsx
│ ├── utils/
│ │ └── helpers.ts
│ └── index.ts
├── package.json
├── tsconfig.json
└── README.md
`
Development
$3
`bash
npm install
`
$3
`bash
npm run build
`
$3
`bash
npm link
document_it -p
`
$3
`bash
npm run clean
`
Publishing to npm
1. Update version in package.json
2. Build the project:
`bash
npm run build
`
3. Login to npm:
`bash
npm login
`
4. Publish:
`bash
npm publish
``