Skip to content
/ treei Public

A node command line tool to generate directory structure tree

License

Notifications You must be signed in to change notification settings

w2xi/treei

Folders and files

NameName
Last commit message
Last commit date

Latest commit

fa7de00 · Jan 19, 2025

History

66 Commits
Mar 11, 2024
Mar 10, 2024
Jan 15, 2025
Jan 15, 2025
Mar 10, 2024
Mar 10, 2024
Mar 10, 2024
Dec 14, 2024
Dec 11, 2024
Mar 10, 2024
Feb 19, 2024
Jan 18, 2025
Jan 19, 2025
Jan 15, 2025
Mar 10, 2024

Repository files navigation

treei

npm

treei is a node command line tool to generate directory structure tree.

Installation

npm i treei -g

Usage

$ treei -h
Usage: treei [options]

Generate a directory structure tree

Options:
  -V, --version          output the version number
  -i, --ignore <ig>      ignore specific directory name, separated by comma or '|'
  -l, --layer <layer>    specify the layer of output
  -d, --directory <dir>  specify the directory to generate structure tree
  -f, --only-folder      output folder only
  --icon                 output emoji icon, prefixing filename or directory
  -o, --output <output>  export content into a file, appending mode by default
  -c, --clipboard        copy the output to clipboard
  -h, --help             display help for command

Examples

Ignore .git and node_modules directory.

$ treei -i '.git|node_modules' # or treei -i '.git,node_modules'
├──.github
|   └──workflows
|   |   ├──release.yml
|   |   └──test.yml
├──.vscode
|   └──settings.json
├──dist
|   └──index.js
├──src
|   ├──config.ts
|   ├──generate.ts
|   ├──handleOptions.ts
|   ├──index.ts
|   ├──sort.ts
|   ├──toTree.ts
|   ├──type.ts
|   └──utils.ts
├──test
|   ├──handleOptions.spec.ts
|   ├──sort.spec.ts
|   └──toTree.spec.ts
├──.editorconfig
├──.eslintrc
├──.gitignore
├──.prettierignore
├──.prettierrc.mjs
├──CHANGELOG.md
├──LICENSE
├──package.json
├──pnpm-lock.yaml
├──README.md
└──tsconfig.json

Show emoji icon, prefixing filename or directory.

$ treei -i '.git,node_modules' --icon
├──📁.github
|   └──📁workflows
|   |   ├──📄release.yml
|   |   └──📄test.yml
├──📁.vscode
|   └──📄settings.json
├──📁dist
|   └──📄index.js
├──📁src
|   ├──📄config.ts
|   ├──📄generate.ts
|   ├──📄handleOptions.ts
|   ├──📄index.ts
|   ├──📄sort.ts
|   ├──📄toTree.ts
|   ├──📄type.ts
|   └──📄utils.ts
├──📁test
|   ├──📄handleOptions.spec.ts
|   ├──📄sort.spec.ts
|   └──📄toTree.spec.ts
├──📄.editorconfig
├──📄.eslintrc
├──📄.gitignore
├──📄.prettierignore
├──📄.prettierrc.mjs
├──📄CHANGELOG.md
├──📄LICENSE
├──📄package.json
├──📄pnpm-lock.yaml
├──📄README.md
└──📄tsconfig.json

Export output into result.md, and append mode by default.

$ treei -i '.git,node_modules' --icon -o result.md
├──📁.github
|   └──📁workflows
|   |   ├──📄release.yml
|   |   └──📄test.yml
├──📁.vscode
|   └──📄settings.json
├──📁dist
|   └──📄index.js
├──📁src
|   ├──📄config.ts
|   ├──📄generate.ts
|   ├──📄handleOptions.ts
|   ├──📄index.ts
|   ├──📄sort.ts
|   ├──📄toTree.ts
|   ├──📄type.ts
|   └──📄utils.ts
├──📁test
|   ├──📄handleOptions.spec.ts
|   ├──📄sort.spec.ts
|   └──📄toTree.spec.ts
├──📄.editorconfig
├──📄.eslintrc
├──📄.gitignore
├──📄.prettierignore
├──📄.prettierrc.mjs
├──📄CHANGELOG.md
├──📄LICENSE
├──📄package.json
├──📄pnpm-lock.yaml
├──📄README.md
└──📄tsconfig.json

Copy the output to clipboard.

$ treei -i '.git,node_modules' --icon -c

License

MIT

About

A node command line tool to generate directory structure tree

Resources

License

Stars

Watchers

Forks

Packages

No packages published