|(require semver)||package: semver|
The semver specification provides a standardized way to represent version information in a semantic way that can be used for smart and effective dependency management. By using a standardized, machine-readable format for parsing versions and specifying version ranges, dependency managers can automatically select patched versions of software without introducing breaking changes.
The original semver specification imposes very strict rules about what version numbers must mean. In practice, this is not always practical, but following the guidelines loosely allows for the most benefit. The ferver specification describes a reinterpretation of the semver rules while still being compatible with semver’s format, so it can still be used with this library.
A semver version is composed of three numbers separated by dots, the major, minor, and patch version numbers. When comparing version numbers, these values are compared in order, and earlier numbers take precedence.
Additionally, a pre-release label may be appended to the version by adding a hyphen, then including an arbitrary number of dot-delimited groups. The contents of the groups must be limited to ASCII numbers and letters and hypens ([0-9A-Za-z]). The groups are used in version comparisons similarly to the main version numbers. Groups that contain non-numeric characters are compared lexicographically (ASCII ordering), while those that are strictly numeric are compared as integers.
Furthermore, build metadata may be included at the end of the string. Build metadata takes the same form as pre-release labels, but it is indicated using a + instead of a hyphen. However, build metadata is always ignored in all version operations.
The following are all examples of well-formed version strings:
"0.0.0" "1.2.3" "11.905.67" "2.0.3-beta.0" "2.0.3-pre-alpha.1.2" "2.0.3+b.1056" "2.0.3-pre-alpha.1.2+b.1056"
"*" "1.2.3" ">=1.2.3" "~1.2.3" "~1.2" "^0.2.4" "<2.0.0"
For information about the semantics of the different comparators, see node-semver.
a : String b : String (semver-version<? a b) → Boolean a : String b : String (semver-version>? a b) → Boolean a : String b : String (semver-version<=? a b) → Boolean a : String b : String (semver-version>=? a b) → Boolean a : String b : String