directory-tree-structure

0.1.8 • Public • Published

Directory Tree Structure

套件說明

此套件提供一個 dir-tree 指令,可於終端機視窗列印資料夾的樹狀結構。

#如果沒有給參數,預設會以當前路徑執行
dir-tree
# 可以指定要列印的目標
dir-tree --root=D:\\k8s

預設會折疊以下資料夾:

.git
nod_modules
objects

也可以自行指定於 --collapse 參數。

安裝後執行

npm i directory-tree-structure -g

安裝後可於CMD直接執行:

# 預設參數的簡易用法
dir-tree
# 提供路徑參數
dir-tree --root=d:\\k8s
# 完整參數範例,傳入多次 collapse 值以表達陣列參數。
dir-tree --root=D:\\k8s --collapse=nod_modules --collapse=objects

免安裝執行

透過 npx 免安裝執行

# 可傳遞參數給 bin 指令
npx directory-tree-structure --root=d:\\k8s

透過 npm exec 免安裝執行

# 注意要填入雙連字號 -- 靠素 npm 停止解析命令行選項以傳遞參數給套件
npm exec -- directory-tree-structure --root=d:\\k8s

輸出範例

[.]
 ├─[.git]
 │  └─(...)
 ├─[.vscode]
 │  └─launch.json
 ├─[bin]
 │  └─dir-tree
 ├─[node_modules]
 │  └─(...)
 ├─.gitattributes
 ├─.gitignore
 ├─index.js
 ├─package-lock.json
 ├─package.json
 └─ReadMe.md

Readme

Keywords

none

Package Sidebar

Install

npm i directory-tree-structure

Weekly Downloads

2

Version

0.1.8

License

ISC

Unpacked Size

7.17 kB

Total Files

7

Last publish

Collaborators

  • benjqlee