Bump a package version using `npm version`

Today’s interesting questions is how can I bump the package version on package.json automatically without have to write my own script to do it. We can do it manually by editing the package.json or write a script to do it, but I wonder if npm having this built-in command.

So, I asked Google first by query “how to update package.json version automatically”, read over some Stackoverflow discussions and finally lead to npm-version documentation. We can use`npm version` to bump package version. It also create a version commit and annotated tag automatically.

After I know this command, things just got more better…

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s