This article's content
Semantic Versioning

A version of 3.6.12 means

  • 3 is major version, increment if you have changes that break backward compatibility
  • 6 is minor version, increment if you have backward compatible new features
  • 12 is patch release, increment if you have backward compatible new bug fixes

Allowing upgrades in package.json

  • Use tilde ~1.0.4 to allow update to newer patch releases, e.g. to 1.0.5 but not 1.1.0
    • Using ~ with only major version specified will allow minor changes, e.g. ~3 updates to anything between >=3.0.0 <4.0.0 which is the same as specifying 3.x
  • Use caret ^1.0.4 to allow update to newer minor releases, e.g. to 1.1.0 but not 2.0.0
    • More specifically caret allows changes that do not modify the first non-zero digit in the version, so ^0.4.2 updates to anything between >=0.4.2 <0.5.0
  • Use * to allow update to newer major releases, e.g. to 2.0.0

About Author

Mathias Bothe To my job profile

I am Mathias from Heidelberg, Germany. I am a passionate IT freelancer with 15+ years experience in programming, especially in developing web based applications for companies that range from small startups to the big players out there. I create Bosycom and initiated several software projects.