@jody-zeitler/version-it
v1.0.0
Published
Query NPM for the latest version of this package at the current minor version. Return the full version string with an incremented or zeroed patch version.
Downloads
4
Readme
version-it
Query NPM for the latest version of the package in the current working directory at the current minor version. Set the patch version to the next available value.
Local script
package.json
{
"devDependencies": {
"@jody-zeitler/version-it": "^1.0.0"
},
"scripts": {
"bump": "version-it"
}
}
publish script
$ npm run bump && npm publish
incrementing version
v1.0.1
+ [email protected]
Global script
publish script
$ npm install -g @jody-zeitler/version-it
$ version-it && npm publish
incrementing version
v1.0.2
+ [email protected]
Usage with release tags
If you need to increment on a particular tag, use version-it tag
to guess which tag to use based on the version in package.json, e.g. "7.0.0-next.0" will return "next". If there is no tag found in the version, "latest" will be returned, which is the default tag. Pass this value into npm publish
.
$ version-it && npm publish --tag "$(version-it tag)"
incrementing version
v7.0.0-next.1
+ [email protected]
Read-only command
Use version-it peek
to print the next available version without actually writing it to the package.json file.
$ version-it peek
2.3.2