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
# globel install
npm install -g ctree
# Any place, any folder
ctree -p src/
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:
// .dirrc.js
module.exports = {
path: './src',
ignore: ['node_modules/', '.git/'],
limit: 0,
port: 8080
}
Key | Command Key | description | defaultValue |
---|---|---|---|
path | p | The path of the directory tree | src/ |
config | c | The path of the custom configurations | .dirrc.js |
port | d | The port number, only useful in server mode | 8080 |
output | o | The output file name, only useful in txt img page mode |
ctree.[txt, png, html] |
limit | i | Limit display level, 0 is unlimited |
0 |
ignore | g | Ignore files spanning tree | ['node_modules/', '.git/'] |