GithubHelp home page GithubHelp logo

joscha / indexifier Goto Github PK

View Code? Open in Web Editor NEW
10.0 3.0 4.0 1.92 MB

Generate an index from a directory

License: MIT License

JavaScript 100.00%
indexing tree html index listing indexer index-generator

indexifier's Introduction

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

indexifier's People

Contributors

christianscott avatar dependabot[bot] avatar greenkeeper[bot] avatar joscha avatar joshua-leyshon-canva avatar zaijo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

indexifier's Issues

An in-range update of commander is breaking the build 🚨

The dependency commander was updated from 2.18.0 to 2.19.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

commander is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

Release Notes for v2.19.0
  • Removed newline after Options and Commands headers (#864)
  • Bugfix - Error output (#862)
  • Fix to change default value to string (#856)
Commits

The new version differs by 6 commits.

  • 78b7dbd version bump 2.19.0
  • 6aafa20 prefixed error messages with "error:"
  • 6c0c1f6 removed newline above and below errors
  • b6549f2 removed indentation from errors
  • 2c20e91 removed newline after options and commands headers
  • 4c294c1 Fix to change default value to string

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

.git folder shouldn't be indexed

currently if you run something like command below on a project with .git

 ./ --extensions .html --html > index.html

you might get output like this:

<!doctype html>
<html>
    <head>
        <meta charset="UTF-8">
        <title>.</title>
        <style>
            * {
                font-family: monospace;
            }
        </style>
    </head>
    <body>
        <a href="./">.</a><br/>
├─┬ <a href="./.git">.git</a><br/>
│ ├── <a href="./.git/hooks">hooks</a><br/>
│ ├── <a href="./.git/info">info</a><br/>

...

│ │ ├── <a href="./.git/objects/0b">0b</a><br/>
│ │ ├── <a href="./.git/objects/0e">0e</a><br/>
│ │ ├── <a href="./.git/objects/16">16</a><br/>
│ │ ├── <a href="./.git/objects/1d">1d</a><br/>
│ │ ├── <a href="./.git/objects/32">32</a><br/>
│ │ ├── <a href="./.git/objects/33">33</a><br/>
│ │ ├── <a href="./.git/objects/3f">3f</a><br/>
│ │ ├── <a href="./.git/objects/40">40</a><br/>
│ │ ├── <a href="./.git/objects/4b">4b</a><br/>
│ │ ├── <a href="./.git/objects/55">55</a><br/>
│ │ ├── <a href="./.git/objects/57">57</a><br/>
│ │ ├── <a href="./.git/objects/5a">5a</a><br/>
│ │ ├── <a href="./.git/objects/67">67</a><br/>
│ │ ├── <a href="./.git/objects/68">68</a><br/>
│ │ ├── <a href="./.git/objects/76">76</a><br/>
│ │ ├── <a href="./.git/objects/87">87</a><br/>
│ │ ├── <a href="./.git/objects/88">88</a><br/>
│ │ ├── <a href="./.git/objects/a1">a1</a><br/>
│ │ ├── <a href="./.git/objects/ae">ae</a><br/>
│ │ ├── <a href="./.git/objects/bb">bb</a><br/>
│ │ ├── <a href="./.git/objects/bd">bd</a><br/>
│ │ ├── <a href="./.git/objects/cb">cb</a><br/>
│ │ ├── <a href="./.git/objects/d1">d1</a><br/>
│ │ ├── <a href="./.git/objects/d5">d5</a><br/>
│ │ ├── <a href="./.git/objects/da">da</a><br/>

...


    </body>
</html>

ignore flag request

--ignore flag would be super useful to for example avoid vendor and build folders

Ambiguous flag "-h"

Please - fix the help text of indexifier, because it states "-h" as both help and html. I suggest removing the "-h" from help line.

The automated release is failing 🚨

🚨 The automated release from the master branch failed. 🚨

I recommend you give this issue a high priority, so other packages depending on you could benefit from your bug fixes and new features.

You can find below the list of errors reported by semantic-release. Each one of them has to be resolved in order to automatically publish your package. I’m sure you can resolve this 💪.

Errors are usually caused by a misconfiguration or an authentication problem. With each error reported below you will find explanation and guidance to help you to resolve it.

Once all the errors are resolved, semantic-release will release your package the next time you push a commit to the master branch. You can also manually restart the failed CI job that runs semantic-release.

If you are not sure how to resolve this, here is some links that can help you:

If those don’t help, or if this issue is reporting something you think isn’t right, you can always ask the humans behind semantic-release.


Invalid npm token.

The npm token configured in the NPM_TOKEN environment variable must be a valid token allowing to publish to the registry https://registry.npmjs.org/.

If you are using Two-Factor Authentication, make configure the auth-only level is supported. semantic-release cannot publish with the default auth-and-writes level.

Please make sure to set the NPM_TOKEN environment variable in your CI with the exact value of the npm token.


Good luck with your project ✨

Your semantic-release bot 📦🚀

Package missing `version`

I assume that's not intentional. Was curious why semantic-release script was there and 2.0.0 seems to be the latest release on npm, but the package.json in GitHub doesn't have version.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.