reach-version-manager v1.0.0
Overview
reach-version-manager
is a command line tool which can fetch version
information from the npmjs registry for a given package. When this tool is
installed using npm link
, it registers an alias, rvm
which can be used as
well.
Developers should use this tool when deciding what to set the package.json version property to when pushing changes to git. This allows the developer to avoid version conflicts when the package is pushed to npmjs or a production deployment.
Developers are still responsible for knowing if they need to bump the
Usage
The tool is invoked from the command line and supports 3 verbs: all, next, current. The tool can be configured to extract a package name for a npm package.json file residing in the current working directory.
Verb: current
This verb extracts the "current" version of the package from npm. This is the highest version available on npm according to semantic versioning rules.
Example invocation:
$ rvm current --use-package
0.7.0
You may use the --level
parameter to return only the version component of
interest:
$ rvm current --use-package --level=major
0
The output may be formatted as JSON if desired:
$ rvm current --use-package --format=json
"0.7.0"
Verb: next
This verb extracts the "next" version of the package from npm. You may specify
which version component you want to increment using the --level
command line
argument. If --level
is not specified, the next
verb will assume that you
would like to increment the patch component. When incrementing a version
component, the version components at the lower levels are reset to 0. For
example, if the minor version component is incremented for the version 1.2.3,
the result will be 1.3.0.
Example invocation (assuming current version is 0.7.0):
$ rvm next --use-package
0.7.1
Example invocation (assuming current version is 0.7.8):
$ rvm current --use-package --level=major
1.0.0
Verb: all
This verb extracts the current, next, and all versions of the package from npm.
Example invocation:
$ rvm all --use-package
current: 0.7.0
next: 0.6.1
versions: ["0.0.2","0.2.0","0.3.0","0.4.0","0.5.0"]
The "current" and "next" portions returned by all
respect any command line
arguments passed which would affect the next
or current
verbs (e.g.
--level
or --format
).
3 years ago