New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

lazy-load-grunt-config

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

lazy-load-grunt-config

lazy-load-grunt-config is a Grunt library that allows you to break up your Gruntfile config by task

latest
Source
npmnpm
Version
0.1.1
Version published
Weekly downloads
3
50%
Maintainers
1
Weekly downloads
 
Created
Source

lazy-load-grunt-config NPM Version

lazy-load-grunt-config is a Grunt library that allows you to break up your Gruntfile config by task. It was inspired by load-grunt-config

Installing

npm install lazy-load-grunt-config

Features

  • Each task has its own config file. Example: copy.js, uglify.js, etc.
  • Auto load all grunt plugins. Uses load-grunt-tasks.
  • Support for returning a function.
  • Easily register task aliases with aliases.js

API

Basic

module.exports = function(grunt) {
    require('lazy-load-grunt-config')(grunt);
};

With options

module.exports = function(grunt) {
    var path = require('path');

    require('lazy-load-grunt-config')(grunt, {
        // Path to task files, defaults to grunt dir.
        configPath: path.join(process.cwd(), 'grunt'),

        // Auto grunt.initConfig
        init: true,

        // Data passed into config. Can use with <%= test %>
        data: {
            test: false
        },

        // Can optionally pass options to load-grunt-tasks. If you set to false, it will disable auto loading tasks.
        loadGruntTasks: {
            pattern: 'grunt-*',
            config: require('./package.json'),
            scope: 'devDependencies'
        }
    });
};

Aliases

If your grunt/ folder contains an aliases.js file, lazy-load-grunt-config will use that to define your tasks aliases (like grunt.registerTask('default', ['nodemon']);).

grunt/aliases.js returning an object.

module.exports = {
    'default': [],
    css: ['copy', 'stylus']
};

grunt/aliases.js returning a function. Useful if there is need to compute something before return.

module.exports = function (grunt, options) {
    
    // Computation example:
    // --------------------

    var css = ['copy', 'stylus'];
    if (grunt.option('notify', false)) {
        css.push('notify:css');
    }

    return {
        'default': [],
        css: css
    };
};

Change log

0.1.0 / 2015-10-28

  • Initial commit

Keywords

gruntplugin

FAQs

Package last updated on 28 Oct 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