Get tree object with a directory, example:
{ path: '/Users/solome/dir.tree.js/src',
sub:
[
{ path: '/Users/solome/dir.tree.js/src/app.js',
sub: [] },
{ path: '/Users/solome/dir.tree.js/src/debug.js',
sub: [] }
]
}
npm install -g dir.tree.js
Node
import DirTree from 'dir.tree.js'
const path = __dirname
const dirTree = DirTree(path)
Commander: list contents of directories in a tree-like format.
$ dt -s
Output demo:
.
├── dir
| └── subdir
| └── empty.file
└── dirtree.js
MIT