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
-h, --html Enable to generate HTML output
-L, --no-link-folders Do not link folders when in HTML output mode
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>
isHtml=false: Boolean,
linkFolders=true: Boolean
}]);
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
});