Packtag helps you keeping package.json version aligned with git tags.
It works in 2 different ways:
if -x option is used, it checks the package.json version, if it is aligned, then it just executes git tag. If the version mismatach, it updates it, commits it to git and then execute git tag
if -b option is used, it reads the package.json version, and then updates it using the -t option.
Eventually it commits the changes and execute git tag
Install packtag globally
npm install -g packtag
or add packtag as dev-dependencies of your project
with yarn
yarn add -D packtag
with npm
npm install -D packtag
When you need to tag your repo, now just execute:
- 
if installed globally packtag -x 1.2.3 
- 
if installed as project dependency node_modules/.bin/packtag -x 1.2.3 
packtag -x 1.2.3 it will set version to 1.2.3. If version is minor to the one found in package.json it will raise an error.
packtag -b -type major it will take current package.json version and bump the major version
more to come...