
Product
Rust Support Now in Beta
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.
dir-tree-creator
Advanced tools
npm like directory tree structure creator based on the given root path
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
FAQs
npm like directory tree structure creator based on the given root path
The npm package dir-tree-creator receives a total of 232 weekly downloads. As such, dir-tree-creator popularity was classified as not popular.
We found that dir-tree-creator demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.
Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.