# get-dir-tree **Repository Path**: sk20020228/get-dir-tree ## Basic Information - **Project Name**: get-dir-tree - **Description**: 生成指定路径目录树 - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-02-13 - **Last Updated**: 2025-08-08 ## Categories & Tags **Categories**: Uncategorized **Tags**: npm ## README # nodejs生成目录树 > 获取目录树 ## 全局安装 ```bash npm i @hsk766187397/get-tree -g ``` ## 使用方法 ```bash Usage: get-dir-tree [dirPath] [shouldDeepTraverse] [outputPath] [ignorePatterns] Options: dirPath 目标目录路径,默认为当前目录。 shouldDeepTraverse 控制遍历深度,0表示全部遍历,1表示只获取当前层,其他正整数表示对应层数,默认为1。 outputPath 输出文件路径,默认不保存到文件。 ignorePatterns 过滤规则,默认过滤.git,node_modules。 -h, --help 显示帮助信息。 Examples: get-dir-tree ./ 1 output.md get-dir-tree ./ 2 output.md get-dir-tree ./ 0 output.md get-dir-tree -h (or --help) for help ```