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

extend-grunt-api

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

extend-grunt-api

extend grunt api, like grunt.file.copyDir...

  • 0.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

extend-grunt-api

extend grunt api, like grunt.file、grunt.task, and more.

Getting started

In order to extend grunt API, first you need to install this plugin

npm install extend-grunt-api --save-dev

then, in your Gruntfile.js, add a line of code. All done, enjoy yourself. Currently, there are only a few APIs supplied, if you have more need or ideas, please let me know.

require('extend-grunt-api')(grunt);

grunt.file

grunt.file.copyDir(src, dest)

Copy directory src to dest recursively.

usage:

grunt.file.copyDir('src', 'dest');

grunt.task

grunt.task.getCurName()

Inside a grunt task, you can get the name of the task currently run by using this.name, but it doesn't work outside of task.

usage:

module.exports = function(grunt){

  require('extend-grunt-api')(grunt);
  
  grunt.log.write(grunt.task.getCurName()); // you will get 'hello' if you run task with 'grunt hello'
  
  grunt.registerTask('hello', function(){
    // sth todo
  });
};

Keywords

FAQs

Package last updated on 26 Jun 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