JSPM

husky

0.12.0-0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 19428011
  • Score
    100M100P100Q215077F
  • License MIT

Prevents bad commit or push (git hooks, pre-commit/precommit, pre-push/prepush, post-merge/postmerge and all that stuff...)

Package Exports

  • husky/bin/install
  • husky/bin/uninstall
  • husky/package.json

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (husky) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

husky npm version Build Status

Git hooks made easy

Husky can prevent bad commit, push and more 🐶 woof!

Used by jQuery, Hyper, Paper.js, Kibana, JSON Server, Hotel, ... and many other awesome projects.

Usage

npm install husky --save-dev
// package.json
{
  "scripts": {
    "precommit": "npm test",
    "prepush": "npm test",
    "...": "..."
  }
}
git commit -m "Keep calm and commit"

Existing hooks aren't replaced and adding --no-verify to your git commands lets you bypass hooks. You can also use any Git hook. Optionally include the environment variable $GIT_PARAMS in your scripts to access any command-line parameters provided by git.

Tricks

Debug hooks easily

If you need to debug hooks, use npm run <script-name>, for example:

npm run precommit
Git GUI clients support

If you've installed Node using the standard installer, nvm or homebrew, git hooks will be executed even in GUI applications.

In the case of nvm, husky will try to use the default installed version or use the project .nvmrc.

Accessing Git params

Git params can be found in GIT_PARAMS environment variable.

Cygwin support

Yes :)

Uninstall

To uninstall husky and Git hooks, simply run:

npm uninstall husky --save-dev

License

MIT - Typicode 🌵