autohook

1.0.2 • Public • Published

Autohook

Autohook allows you to easily subscribe your npm scripts to git hooks

Usage

The simplest way to use autohook is to create a npm script that will generate git hook for you.

Install

npm i autohook --save-dev

Create a hooking script

Somewhere in package.json

{
  "scripts": {
    "check": "eslint ./src stylelint ./src && npm test",
    "hook": "autohook check pre-push"
  }
}

This will create a pre-push git hook for you that runs check npm script.

Install a hook

Thereafter one may run hook script manually by executing

npm run hook

Or you may prefer to automate this by adding your hook script to one of npm's lifecycle scripts like prepare. This will automatically hook anyone who runs local npm install.

Package Sidebar

Install

npm i autohook

Weekly Downloads

0

Version

1.0.2

License

MIT

Unpacked Size

2.2 kB

Total Files

4

Last publish

Collaborators

  • nyrkovalex