Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
indexifier
Advanced tools
This module generates a tree view of a given directory.
Usage: indexifier [options] <dir>
Options:
-h, --help output usage information
-V, --version output the version number
-e, --extensions <list> The extensions to take into account (defaults to .htm,.html)
-I, --include <regexp> Include files and directories that are matched by this regular expression (defaults to all)
-E, --exclude <regexp> Exclude files and directories that are matched by this regular expression (defaults to none)
-H, --html Enable to generate HTML output
-L, --no-link-folders Do not link folders when in HTML output mode
-F, --no-empty-directories Do not include empty directories
-D, --max-depth Limit results to a maximum sub-directory depth
npm install -g indexifier
indexifier ./ --extensions .html,.htm
would generate something like this:
A
├─┬ B
│ └── c.html
├── d.html
└── e.html
There is also an HTML flag that would generate the above output as linked HTML:
indexifier --extensions .html --html .
<!-- ... -->
<a href="./">A</a><br/>
├─┬ <a href="./B">B</a><br/>
│ └── <a href="./B/c.html">c.html</a><br/>
├── <a href="./d.html">a.html</a><br/>
└── <a href="./e.html">b.html</a><br/>
<!-- ... -->
The links are always relative to the given directory.
indexifier(String directory [, opts={
fileTypes: Array.<String>,
include=undefined: Regexp,
exclude=undefined: Regexp,
isHtml=false: Boolean,
linkFolders=true: Boolean,
emptyFolders=true: Boolean,
maxDepth=Infinity: Number,
}]);
npm install indexifier --save
Tree of files:
const indexifier = require('indexifier');
const treeOfFiles = indexifier(__dirname);
Tree of HTML files:
const indexifier = require('indexifier');
const treeOfHtmlFiles = indexifier(__dirname, { fileTypes: ['.html'] });
or for HTML output:
const indexifier = require('indexifier');
const treeOfJpegFiles = indexifier(__dirname, {
fileTypes: ['.jpg', '.jpeg'],
isHtml: true
});
FAQs
Generate an index from a directory
The npm package indexifier receives a total of 52,969 weekly downloads. As such, indexifier popularity was classified as popular.
We found that indexifier 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.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.