Husky

Husky

Author: huyikai

nodejslibrary

Install

Terminal window
npm install husky -D

Usage

Edit package.json > prepare script and run it once:

Terminal window
npm pkg set scripts.prepare="husky install"
npm run prepare

Add a hook:

Terminal window
npx husky add .husky/pre-commit "npm test"
git add .husky/pre-commit

Make a commit:

Terminal window
git commit -m "Keep calm and commit"
# `npm test` will run every time you commit

Documentation

https://typicode.github.io/husky