
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
tree-cli-tool
Advanced tools
A powerful command-line tool to display directory tree structure with various configuration options and output formats
一个功能强大的命令行工具,用于显示目录树状结构,支持多种配置选项和输出格式。
npm install -g tree-cli-tool
# 显示当前目录的树状结构
tree-cli
# 显示指定目录的树状结构
tree-cli /path/to/directory
# 限制遍历深度
tree-cli -d 3
# 显示文件大小
tree-cli -s
# 输出为 JSON 格式
tree-cli -f json
# 排除特定文件/目录
tree-cli -e "node_modules" "*.log" ".git"
[path] - 目标目录路径(默认:当前目录)-d, --max-depth <number> - 最大遍历深度,-1 表示无限制(默认:-1)-f, --format <type> - 输出格式:text|json|markdown(默认:text)-e, --exclude <patterns...> - 排除模式(支持 glob 风格)--include-types <types...> - 只包含指定文件类型(扩展名)--exclude-types <types...> - 排除指定文件类型(扩展名)-i, --ignore-pattern <regex> - 正则表达式忽略模式-a, --show-hidden - 显示隐藏文件和目录-s, --show-size - 显示文件大小--show-date - 显示修改时间-D, --dirs-only - 只显示目录--no-color - 禁用彩色输出-o, --output <file> - 输出到文件而不是标准输出快速查看目录结构,自动排除常见的构建目录:
tree-cli quick [path] [-d depth]
自动排除:node_modules, .git, dist, build, .next, .nuxt
开发者友好的视图,排除更多构建和缓存目录:
tree-cli dev [path] [-d depth]
自动排除:node_modules, .git, dist, build, .next, .nuxt, coverage, .nyc_output, .cache, tmp, temp, *.log, .DS_Store, Thumbs.db
tree-cli
tree-cli -d 2 -s
tree-cli --include-types js ts jsx tsx
tree-cli -e "node_modules" "dist" --exclude-types log tmp
tree-cli -f json -o tree.json
tree-cli -i "test.*\\.js$"
tree-cli dev -d 3
project/
├── src/
│ ├── components/
│ │ └── Button.tsx
│ └── index.ts
├── package.json
└── README.md
2 directories, 3 files
{
"tree": {
"name": "project",
"path": "/path/to/project",
"isDirectory": true,
"children": [...]
},
"stats": {
"totalFiles": 3,
"totalDirectories": 2,
"totalSize": 1024
}
}
# Directory Tree: project
- **project**/
- **src**/
- **components**/
- Button.tsx
- index.ts
- package.json
- README.md
## Statistics
- **Directories**: 2
- **Files**: 3
import { generateTree } from 'tree-cli-tool';
const result = await generateTree({
path: './my-project',
maxDepth: 3,
format: 'json',
exclude: ['node_modules', '.git'],
showSize: true,
});
console.log(result.formatted);
console.log('Stats:', result.stats);
# 克隆仓库
git clone https://github.com/oyal/tree-cli-tool.git
cd tree-cli-tool
# 安装依赖
npm install
# 开发模式运行
npm run dev
# 构建项目
npm run build
# 运行测试
npm test
# 代码格式化
npm run format
# 检查代码格式
npm run format:check
项目配置了以下代码质量工具:
代码质量检查 在以下时机自动运行:
本项目使用 GitHub Actions 自动化发布流程:
自动发布 (推荐):
手动发布:
npm version patch # 或 minor, major
git push origin main --tags
git checkout -b feature/amazing-feature)git commit -m 'Add some amazing feature')git push origin feature/amazing-feature)MIT
FAQs
A powerful command-line tool to display directory tree structure with various configuration options and output formats
We found that tree-cli-tool demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.