package
npm like directory tree structure creator based on the given root path
npm install dir-tree-creatorGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Tagged topics.
Estimated unpacked size across 3 packages.
11.6 kB
Includes dependencies.
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.
npm i dir-tree-creator
dirtree(dir[, opts], cb)
dir <String> root directory pathopts <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 structureconst dirTree = require('dir-tree-creator')
dirTree('some/dir', (err, tr) => {
if (err) return console.error(err)
console.log(tr)
})const dirTree = require('dir-tree-creator')
dirTree('some/dir', { label: 'custom label' }, (err, tr) => {
if (err) return console.error(err)
console.log(tr)
})custom label
├─┬ dir0
│ └── file0.js
├─┬ dir1
│ ├─┬ dir2
│ │ └── file2.js
│ └── file1.md
├── file-under-root.js
└── .gitignore