Here’s a useful resource on how to use Git hooks:
And an npm package to run them from package.json files:
package.json