pre-commit-package-version
v1.0.7
Published
Check the package version has been incremented before committing
Downloads
21
Maintainers
Readme
📦⬆️ Version number pre-commit hook for npm modules
Why?
Having to remember to update the version in your package.json
when publishing
a new version of your npm module can become annoying...fast.
What?
A pre-commit hook that automatically checks the package.json
version
number in your local branch against the one in your remote master.
How?
All you have to do is run $ npm install pre-commit-package-version --save-dev
in your command line. The pre-commit hook should be added automatically to the git hooks directory.
If you want to manually add the bash script and run tests add the following scripts to your package.json:
"add:hook": "node node_modules/pre-commit-package-version/exec.js"
"test:hook": "node node_modules/pre-commit-package-version/test/exec.test.js"
To manually add the hook to your pre-commit file in .git/hooks
run:
$ npm run add:hook
Tests
To test the hook run the following command:
$ npm run test:hook