ctree
What is ctree?
Through nodeJS quickly generate project directory tree structure. There are four ways:
- server - Open the local server to view tree
- txt - According to the directory structure to generate a txt file
- img - According to the directory structure to generate an image file
- page - According to the directory structure to generate a page
- log - Print the directory structure to the shell, this is default
Dependencies
Install
# globel installnpm install -g ctree
Usage
# Any place, any folderctree -p src/
Option
Can through two ways to configure ctree:
- Through
.js
configuration (default:.dirrc.js
) - Through the command to configure.
The priority is command
> .js
> default
default option:
module.exports = {path: './src',ignore: ['node_modules/', '.git/'],limit: 0,port: 8080}
.js
setting
through // .dirrc.jsmodule.exports = {path: '../ctree/',ignore: ['node_modules/', '.git/'],limit: 0,port: 233}
command
setting
through project path (default: ./src
)
example:
ctree -p src// orctree --path=src
custom config (default: ./dirrc.js
)
example:
ctree -c ./config/.dirrc.js// orctree --config=./config/.dirrc.js
set port (default: 8080
)
example:
ctree server -d 233// orctree server --port=233
The path of the output (default: ./ctree.*
)
example:
ctree img -o ctree.jpgctree page -o ctree.htmlctree txt -o ctree.txt// orctree img --output=ctree.jpgctree page --output=ctree.htmlctree txt --output=ctree.txt
Limit display level, 0
is unlimited (default: 0
)
example:
ctree log -i 3// orctree log --limit=3
Ignore files spanning tree (default: ['node_modules/', '.git/']
)
example:
// ignore Folder, File, A single directory wildcard, Inheritable wildcardsctree -g "['node_modules/', '.gitignore', 'js/*.json', 'asset/**.md']"// orctree --ignore="['node_modules/', '.gitignore', 'js/*.json', 'asset/**.md']"