# extend-grunt-api

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

Latest version **0.0.1** (published 2014-06-26) · ISC license · 0 weekly downloads

## Install

```sh
npm install extend-grunt-api
pnpm add extend-grunt-api
yarn add extend-grunt-api
bun add extend-grunt-api
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2014-06-26 |
| First published | 2014-06-26 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 2 |
| Author | chyingp |
| Maintainers | chyingp |
| Keywords | grunt, api |

## Links

- npm: https://www.npmjs.com/package/extend-grunt-api
- Repository: https://github.com/chyingp/extend-grunt-api
- Issues: https://github.com/chyingp/extend-grunt-api/issues
- npm.io page: https://npm.io/package/extend-grunt-api

## Dependencies (1)

- [underscore](https://npm.io/package/underscore.md) 1.6.0

## Recent versions

- 0.0.1 (latest) — 2014-06-26
- 0.0.0 — 2014-06-26

## README

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:

```js
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:

```js
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
  });
};
```

---
_Source: https://npm.io/package/extend-grunt-api · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
