Here's how this works:
- Include a
git_hooks/
directory in your project, with these two files (plus other hooks if you want, written in a similar style). - Add
"npm"
to yourdevDependencies
inpackage.json
, so that thepre-commit
hook can do its magic. - Add
test
andlint
scripts to yourpackage.json
, e.g.
"scripts": {
"test": "mocha",
"lint": "jshint ./lib --show-non-errors"