Git hooks integration for Node.js projects
See also this module's package.json as an example.
$ npm install git-scripts
.git/hooks of your project is replaced when installed. You can restore it by uninstalling the module.
git-scripts supports all hooks including the following:
$ npm install -g git-scripts
Usage: git-scripts <command> [options]Options:-h, --help output usage information-V, --version output the version numberCommands:install [path] install git-scriptsuninstall [path] uninstall git-scriptsrun <name> [args ...] run arbitrary scripts
NOTE: Usually, you don't need CLI. Hooks are enabled automatically when you install the module locally.
If you would like to use git-scripts programmatically, you can do that.
var scripts = require'git-scripts';var project = scripts'somewhere/yourproject';projectinstallif err throw err;console.log'git-scripts was installed.';projectrun'pre-commit'if err throw err;console.log'pre-commit script succeeded.';;;
var scripts = require'git-scripts';var project = scripts'somewhere/yourproject';
Create a git-scripts instance for
Run an arbitrary command of