Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

indexifier

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

indexifier

Generate an index from a directory

  • 3.3.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
65K
increased by1.01%
Maintainers
1
Weekly downloads
 
Created
Source

Generate an index for a given directory

Greenkeeper badge

Build status npm npm node Commitizen friendly semantic-release

This module generates a tree view of a given directory.

Usage

CLI API

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
Install
npm install -g indexifier
Examples
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.

Node API

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,
                                    }]);
Install
npm install indexifier --save
Examples

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
});

Keywords

FAQs

Package last updated on 13 Apr 2021

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc