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

grunt-module-index

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

grunt-module-index

Auto-build module index file (exports) based on folders and files.

  • 0.1.7
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

grunt-module-index

Grunt task to auto-build module index files (exports) based on folders and files.

Getting Started

This plugin requires Grunt ~0.4.0.

Install this grunt plugin with:

npm install grunt-module-index --save-dev

Then add this line to your project's grunt.js Gruntfile:

grunt.loadNpmTasks('grunt-module-index');

Tests

To do.

Options

format

Type: String Values: coffee, js Default: js

File format and extension.

indentTab

Type: String Default: ' ' (2 spaces)

Indentation characters.

notice

Type: String

Optional file header message.

omitDirs

Type: Array|String Default: []

Omit these directory names for the object hierarchy.

Example: omitDirs: ['src']

pathPrefix

Type: String

Optional prefix for every file path.

Example: pathPrefix: './' and a file in src/ ends as require('./src/...

requireWithExtension

Type: Boolean Default: false

Include file extensions on require calls.

flatIndex

Type: Boolean Default: false

Object hierarchy omits every directory.

Examples

Basic (javascript)
moduleIndex: {
  build: {
    src: ["src/"],
    options: {
      omitDirs: ["src"]
    }
  }
}
Full (coffee)
moduleIndex:
  build:
    src: ["modules/**/*.js", "components", "mixins/"]
    dest: "index.coffee"
    options:
      format: "coffee"
      indentTab: "\t"
      notice: "Generated with grunt"
      omitDirs: ["src"]
      pathPrefix: "./"
      requireWithExtension: true

Output example

//! This file was auto-generated by grunt-module-index, DO NOT edit it directly
module.exports = exports = {
  components: {
    nav: {
      nav: require("components/nav/nav"),
      navItem: require("components/nav/navItem")
    },
    form: {
      button: require("components/form/button"),
      input: require("components/form/input")
    }
  }
};
//EOF

License

Copyright (c) 2014-2015 Ignacio Lago

Licensed under the MIT license.

Keywords

FAQs

Package last updated on 26 May 2015

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