@rainydio/next-version
v1.2.1
Published
Print next patch or prerelease package version if package version ends with 0
Downloads
19
Readme
Run next-version
in in directory containing package.json
file.
It will initialize npm to print next appropriate version.
It initializes npm, gets current package version from package.json
,
and requests published versions from npmjs.
If current package version patch or prerelease part ends with zero, it
will print result of semver.inc
on max published version having
same parts up to the last one.
Version in package.json | Published versions | Output of next-version ------------------------|----------------------|----------------------- 1.0.0 | none | 1.0.1 1.1.0 | 1.0.0, 1.0.1 | 1.1.1 1.1.0 | 1.0.0, 1.1.10 | 1.1.11 1.1.0-alpha | 1.1.0, 1.1.0-alpha.3 | 1.1.0-alpha.4 1.1.10 | 1.1.11, 1.1.10 | 1.1.11
Designed to be used during CI builds. Example package.json
"scripts": {
"bump": "npm version --no-git-tag-version $(next-version)"
}
npm run bump && npm publish