/npm-version-git

increment version of package.json according to git log

Primary LanguageJavaScriptMIT LicenseMIT

npm-version-git

Build Status codecov

Increment version of package.json according to git log

How it works

Parse the latest git commit message, search for regex, then bump npm version ? accordingly.

I.e:

last commit message: fixed issue #123 [minor] => npm version minor

last commit message: fixed typo => npm version patch

Install

npm i -g npm-version-git

Usage

In package.json:

"scripts": {
    "prepublishOnly": "npm-version-git",
  }

Options

-rgx

The regex pattern to work on git commit message.

npm-version-git -rgx "\[(major|minor|patch)\]"

-def

The default semver incase regex did't match.

npm-version-git -def patch