npm semantic versioning

Sure you come back to this ;)

article image

syntax:

Patch releases: 1.0 or 1.0.x or ~1.0.4

Minor releases: 1 or 1.x or ^1.0.4

Major releases: * or x

comparators

version: Match version exactly (called "pinned dependencies")

> version: greater than

>= version: greater or equal than

< version: less than

<=version: less or equal than

~version: Allows patch-level changes if a minor version is specified on the comparator. Allows minor-level changes if not.

^version: Allows patch and minor updates for versions 1.0.0 and above, patch updates for versions 0.X >=0.1.0, and no updates for versions 0.0.X.

symbols

1.2.x accepts 1.2.0, 1.2.1,..., but not 1.3.0

* Matches any version

"" (just an empty string) Same as *

version1 - version2 same as >=version1 <=version2.

range1 || range2 is valid if either range1 or range2 are satisfied.




Don't be shy, leave us a comment