New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

init-grunt-config

Package Overview
Dependencies
Maintainers
2
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

init-grunt-config

A Grunt helper to load task configuration files.

  • 0.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
2
Created
Source

init-grunt-config

This plugin helps you organize the configuration of you grunt tasks in separate file for each task.

Usage

Instead of defining everything inside grunt.initConfig, you can do the following:

var load_configs = require("init-grunt-config");

module.exports = function (grunt) {
  grunt.initConfig({ /* any global options */ });

  // Load your tasks here, for example with load-grunt-tasks plugin.

  // Specify a folder that holds all of your
  // task configuration files in the form taskname.js
  load_configs("tasks");

  // ...
};

The tasks folder:

|- Gruntfile.js
|- tasks
|-- clean.js
|-- copy.js
|-- ...

Example task configuration file:

// clean.js

module.exports = {
  tmp_files: ["./tmp/*"],
  sass_files: ["./styles/sass"]
}

Voilà - the Gruntfile is now cleaner and more manageable, and each grunt plugin has its own separate file!

Types of configuration files

Each configuration file can be one of:

  • JSON file

  • JavaScript file that exports an object

    module.exports = { value: true };
    
  • JavaScript file that exports a function

    module.exports = function (grunt) {
      return {
        value: true
      };
    }
    

Tests

Each test is an example project with a Gruntfile testing only one specific feature. You can run it with:

tests/run

Contributing

Please write a test case with before posting a Pull Request. PRs without tests are considered "requests for comments", which are welcome too if you want to discus some feature without necessarily going all the way with implementation.

Keywords

FAQs

Package last updated on 18 Jan 2014

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