ctree
v1.2.1
Published
According to the directory structure of spanning tree
Downloads
32
Maintainers
Readme
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 install
npm install -g ctree
Usage
# Any place, any folder
ctree -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
}
through .js
setting
// .dirrc.js
module.exports = {
path: '../ctree/',
ignore: ['node_modules/', '.git/'],
limit: 0,
port: 233
}
through command
setting
project path (default: ./src
)
example:
ctree -p src
// or
ctree --path=src
custom config (default: ./dirrc.js
)
example:
ctree -c ./config/.dirrc.js
// or
ctree --config=./config/.dirrc.js
set port (default: 8080
)
example:
ctree server -d 233
// or
ctree server --port=233
The path of the output (default: ./ctree.*
)
example:
ctree img -o ctree.jpg
ctree page -o ctree.html
ctree txt -o ctree.txt
// or
ctree img --output=ctree.jpg
ctree page --output=ctree.html
ctree txt --output=ctree.txt
Limit display level, 0
is unlimited (default: 0
)
example:
ctree log -i 3
// or
ctree log --limit=3
Ignore files spanning tree (default: ['node_modules/', '.git/']
)
example:
// ignore Folder, File, A single directory wildcard, Inheritable wildcards
ctree -g "['node_modules/', '.gitignore', 'js/*.json', 'asset/**.md']"
// or
ctree --ignore="['node_modules/', '.gitignore', 'js/*.json', 'asset/**.md']"