dir-tree-creator is a Node.js module that creates an npm like directory tree structure of the given root path and returns the string representation of it.
Install
npm i dir-tree-creator
Usage
dirtree(dir[, opts], cb)
dir<String> root directory path
opts<Object>(optional) object with the following properties:
label<String> label for the root node of the directory tree; if nothing specified, the root path's basename will be used.
hidden<Boolean> determines if hidden files should be included; set to false to ignore hidden files; defaults to true.
cb<Function>
err<Error | null>
dirtree<String> string representation of the directory structure