Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
dir-tree-creator
Advanced tools
#dir-tree-creator
dir-tree-creator is a tiny module that creates an npm like directory tree structure of the given path and returns the string representation of it.
####Install
Please use npm install dir-tree-creator
.
####API
dirtree(options, cb)
options
{Object}
root
{String}
root path
label
{String}
(optional) label for the root node of the directory tree; if nothing specified, then the root path's basename will be used.
ignore
{Array}
(optional) an array of node-glob patterns to ignore. By default, node_modules
and .git
are ignored.
cb
{Function}
err
{Error | null}
dirtree
{String}
String representation of the directory structure
const dir_tree = require('dir-tree-creator');
var opts = {
root: __dirname,
label: 'your custom label',
ignore: ['foo.js', 'test/**'] // ignore foo.js and test dir
};
dir_tree(opts, (er, tr) => {
if (er) {
console.error(er);
} else {
console.log(tr);
}
});
#####Sample output
your 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 294 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.