由于写README.md时需要用到展示目录树的功能,在搜索了一番后发现tree-cli这个插件符合要求, 够美观了。遂决定使用它~
但是在使用过程中,按照github上的使用说明或者npm上的使用方法都 不能忽略node_modules文件夹。
最终尝试了多种格式后,终于成功~
安装
我安装的版本是0.6.4。
npm i tree-cli
选项
- 在options中看到的命令说明如下(仅列举常用):
- –help: outputs a verbose usage listing.
- –version: outputs the version of tree-cli.
- –ignore: ignores directory or file you specify - arrays as comma-delimited strings: ‘node_modules/, .git/, .gitignore’
- -l: max display depth of the directory tree.
- -o: send output to filename.
- 使用命令treee --help看到的说明如下(仅列举常用):
- –help, -h: outputs a verbose usage listing.
- –version: outputs the version of tree-cl