Socket
Socket
Sign inDemoInstall

js.node.grunt.config.helper

Package Overview
Dependencies
446
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    js.node.grunt.config.helper

Node.js Grunt Config Helper Class to Help with Grunt configs and tasks


Version published
Weekly downloads
3
Maintainers
1
Install size
19.2 MB
Created
Weekly downloads
 

Changelog

Source

1.0.1

  • add coverage tests

Readme

Source

tests coverage maintainability

js.node.grunt.config.helper

Node.js Grunt Config Helper Class to Help with Grunt configs and tasks.

npm

npm

npm install --save-dev js.node.grunt.config.helper

Example

Extend Grunt Config Jit Environment

Using the Extend functionality in a jit-grunt Environment like:

Project/
      |build/
      |    |helper/
      |            |_grunt/
      |                  |task_name/
      |                  |        |tasks1.js
      |                  |        |tasks2.js
      |                  |task_name.js
      |Gruntfile.js

Extend task_name.js with task1.js and task2.js from task_name/ directory. task_name.js filename must be the task name of the Grunt Plugin.

// task_name.js
module.exports = function() {
  const path = require('path');
  const GruntConfigHelper = require('js.node.grunt.config.helper');
  const requireDirectory = path.resolve(__dirname, 'task_name');
  const extendConfigHelper = new GruntConfigHelper(requireDirectory);
  const tasks = extendConfigHelper.getTasks();
};

Extend Grunt Config in standard Gruntfile.js Environment

Using the Extend functionality in a standard Grunt Environment:

Project/
|build/
|    |helper/
|            |_grunt/
|                  |task1.js
|                  |task2.js
|Gruntfile.js

Extend Gruntfile.js with task1.js and task2.js by filename. task1.js and task2.js filename must be the task name of the Grunt Plugin.

// Gruntfile.js
module.exports = function (grunt) {

  const path = require('path');
  const GruntConfigHelper = require('js.node.grunt.config.helper');
  const requireDirectory = path.resolve(__dirname, 'build/helper/_grunt');
  const extendConfigHelper = new GruntConfigHelper(requireDirectory, true);
  const tasks = extendConfigHelper.getTasks();
  // Project configuration.
  grunt.initConfig({
    tasks, // {task1: {...}, task2: {...}}
    ...
  })
  ...

Keywords

FAQs

Last updated on 05 May 2018

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc