npm semver calculator

New to semantic versioning? Learn the basics.

{{package}} on npmjs.com

how do I...

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

use the caret (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 pre-release versions like alpha and beta

use the pre-release tag

examples:

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

specify a range of pre-release versions

use comparisons like > with a pre-release 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