# grunt-before-after-hooks

> Hook into right before and right after grunt tasks are run

Latest version **0.1.1** (published 2016-07-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install grunt-before-after-hooks
pnpm add grunt-before-after-hooks
yarn add grunt-before-after-hooks
bun add grunt-before-after-hooks
```

## 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.1.1 |
| Published | 2016-07-11 |
| First published | 2016-07-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Eli White |
| Maintainers | wealthfront |

## Links

- npm: https://www.npmjs.com/package/grunt-before-after-hooks
- Repository: https://github.com/thesavior/grunt-before-after-hooks
- Homepage: https://github.com/thesavior/grunt-before-after-hooks#readme
- Issues: https://github.com/thesavior/grunt-before-after-hooks/issues
- npm.io page: https://npm.io/package/grunt-before-after-hooks

## Dependencies (1)

- [hooker](https://npm.io/package/hooker.md) ^0.2.3

## Recent versions

- 0.1.1 (latest) — 2016-07-11
- 0.1.0 — 2016-07-11
- 0.0.2 — 2016-07-10

## README

# grunt-before-after-hooks [![Build Status](https://travis-ci.org/TheSavior/grunt-before-after-hooks.svg?branch=master)](https://travis-ci.org/TheSavior/grunt-before-after-hooks)

> Add hooks to run before every Grunt task and after they are all complete

## Install

```
$ npm install --save grunt-before-after-hooks
```


## Usage

```js
module.exports = grunt => {
  // require it at the top and pass in the grunt instance
  require('grunt-before-after-hooks')(grunt, {
    beforeEach(currentTask) {
      console.log(JSON.stringify(currentTask));
      /*
      {"nameArgs":"plugin_tester","name":"plugin_tester","args":[],"flags":{},"errorCount":0}
      */
    },
    afterEach(previousTask) {
      console.log(JSON.stringify(currentTask));
      /*
      {"nameArgs":"plugin_tester","name":"plugin_tester","args":[],"flags":{},"errorCount":0}
      */
    },
    after() {

    }
  });

  grunt.initConfig();
}
```

The argument given to the `beforeEach` and `afterEach` hooks are instances of [`grunt.task.current`](http://gruntjs.com/api/inside-tasks#this.name).

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