treef
v1.0.6
Published
输出指定目录的文件与文件夹结构 CLI tool to print folder and file tree with ignore options
Readme
treef
一个简洁实用的命令行工具,用于递归输出指定目录的文件与文件夹结构,同时支持忽略特定文件夹。
A simple CLI tool to recursively display the folder and file tree of a directory, with support for ignoring specified folders.
Features
功能特性 Features 📁 递归展示目录结构 — 自动列出所有子文件与文件夹
🌲 树状结构输出 — 使用符号清晰表示文件层级
🚫 忽略文件夹支持 — 默认忽略常见目录,可手动添加
🧩 显示全部模式 — 使用 --all 参数可无视忽略规则
🖥️ 命令行简单易用
Recursively lists all files and folders
Displays a clean, indented tree-like structure
Supports ignoring specified folders (default: node_modules, dist, .git, test)
--all flag disables all ignore rules
Intuitive CLI experience
- Recursively lists all files and folders.
- Displays a clean tree-like structure.
- Supports ignoring specified folders and their contents.
- Easy to use from command line.
treef
一个简单的命令行工具,用于递归打印指定目录下的文件和文件夹结构,并支持忽略指定的文件夹。
功能特性
- 递归列出所有文件和文件夹。
- 以清晰的树状结构展示。
- 支持忽略指定的文件夹及其所有子内容。
- 命令行简单易用。
Installation 安装
npm install -g treef
Usage 用法
treef <directory> [--ignore folder1,folder2,...] [--all]
directory: 目标目录路径。
--ignore: 可选,逗号分隔的文件夹名列表,忽略这些文件夹及其子内容。
--all 会覆盖默认和自定义的忽略列表。
📂 默认忽略目录(当未使用 --all 时)
node_modules, dist, .git, testExample 示例
# 忽略默认目录(node_modules, dist 等)
treef .
# 忽略默认目录 + 自定义 ignore logs 和 build
treef ./src --ignore logs,build
# 显示所有文件与文件夹(包括 node_modules、.git 等)
treef . --all
License 许可协议
MIT License
👤 作者 Author
appleStven 📧 [email protected]
