Menu

Toshimaru's Blog

Bump version with npm-version

What is semantic versioning?

See the video below (npm official video):

Bump version with npm-version

package.json:

{
  "name": "test",
  "version": "0.0.1",
  "description": "test package",
  "main": "index.js",
  ...
}

Bump major version

$ npm version major
v1.0.0

The result:

$ git tag
v1.0.0

$ git show -q
commit a1e9473677f10b863eacf3289b9c34e759f47b1b (HEAD -> master, tag: v1.0.0)
Author: toshimaru <me@toshimaru.net>
Date:   Thu Apr 15 03:18:09 2020

    1.0.0
{
  "name": "test",
  "version": "1.0.0",
  "description": "test package",
  "main": "index.js",
  ...
}

Bump minor/patch version

$ npm version minor
v1.1.0

$ npm version patch
v1.1.1

another version option

$ npm version [major | minor | patch | premajor | preminor | prepatch | prerelease]

Reference

Load more