Semantically increment a project's version in multiple files

  • ver

Downloads in past


1226.0.25 years ago11 years agoMinified + gzip package size for ver in KB



Semantically increment a project's version in multiple files


npm i -g ver


usage: ver [options] command [files...]

  Semantically increment a project's version in multiple files.

    patch                    Increment patch 0.0.x version
    minor                    Increment minor 0.x.0 version
    major                    Increment major x.0.0 version

   files                     Files to do version replacement in. The nearest package.json and
                             package-lock.json will always be included unless the -P argument is given
    -b, --base <version>     Base version to use. Default is parsed from the nearest package.json
    -c, --command <command>  Run a command after files are updated but before git commit and tag
    -d, --date [<date>]      Replace dates in format YYYY-MM-DD with current or given date
    -r, --replace <str>      Additional replacement in the format "s#regexp#replacement#flags"
    -P, --packageless        Do not include package.json and package-lock.json unless explicitely given
    -g, --gitless            Do not create a git commit and tag
    -p, --prefix             Prefix git tags with a "v" character
    -m, --message <str>      Custom tag and commit message, can be given multiple times. The token
                             _VER_ is available in these messages to fill in the new version
    -C, --changelog          Generate a changelog since the base version tag or if absent, the latest
                             tag, which will be appended to the tag and commit messages
    -v, --version            Print the version
    -h, --help               Print this help

    $ ver patch
    $ ver minor build.js
    $ ver major -p build.js
    $ ver patch -c 'npm run build'
    $ ver patch -C -m '_VER_' -m 'This is a great release'

Signing commits and tags

To automatically sign commits and tags created by ver with GPG add this to your ~/.gitconfig:
  signingkey = <keyid>
  gpgsign = true
  forceSignAnnotated = true

© silverwind, distributed under BSD licence