npm semver calculator

New to semantic versioning? Learn the basics.

how do i...

include everything greater than a particular version in the same major range

use the carat (aka hat) symbol, ^

examples:

  • ^2.2.1

include everything greater than a particular version in the same minor range

use the tilde symbol, ~

examples:

  • ~2.2.0

specify a range of stable versions

use >, <, =, >= or <= for comparisons, or - to specify an inclusive range

examples:

  • >2.1
  • 1.0.0 - 1.2.0
there must be spaces on either side of hyphens

include prerelease versions like alpha and beta

use the prerelease tag

examples:

  • 1.0.0-rc.1
prerelease versions are specified as exact versions. To specify a range, see below.

specify a range of prerelease versions

use comparisons like > with a prerelease tag

examples:

  • >1.0.0-alpha
  • >=1.0.0-rc.0 <1.0.1

include multiple sets of versions

use || to combine

examples:

  • ^2 <2.2 || > 2.3