diff options
author | isaacs <i@izs.me> | 2013-07-12 08:56:59 -0700 |
---|---|---|
committer | isaacs <i@izs.me> | 2013-07-12 08:56:59 -0700 |
commit | 9da67fa5198f3c0839904ae05cbfe88c61b3ad09 (patch) | |
tree | 61c03f98b7c2ae549f67c01e1afe6dcbe84847d6 /deps/npm/node_modules/semver/README.md | |
parent | f88b8dad84cd8f37000e55f0b5de7963cbb252cf (diff) | |
download | node-new-9da67fa5198f3c0839904ae05cbfe88c61b3ad09.tar.gz |
npm: Upgrade to 1.3.3
Diffstat (limited to 'deps/npm/node_modules/semver/README.md')
-rw-r--r-- | deps/npm/node_modules/semver/README.md | 67 |
1 files changed, 29 insertions, 38 deletions
diff --git a/deps/npm/node_modules/semver/README.md b/deps/npm/node_modules/semver/README.md index 2193009685..a315fe8883 100644 --- a/deps/npm/node_modules/semver/README.md +++ b/deps/npm/node_modules/semver/README.md @@ -33,59 +33,50 @@ As a command-line utility: ## Versions -A version is the following things, in this order: - -* a number (Major) -* a period -* a number (minor) -* a period -* a number (patch) -* OPTIONAL: a hyphen, followed by a number (build) -* OPTIONAL: a collection of pretty much any non-whitespace characters - (tag) +A "version" is described by the v2.0.0 specification found at +<http://semver.org/>. A leading `"="` or `"v"` character is stripped off and ignored. -## Comparisons - -The ordering of versions is done using the following algorithm, given -two versions and asked to find the greater of the two: - -* If the majors are numerically different, then take the one - with a bigger major number. `2.3.4 > 1.3.4` -* If the minors are numerically different, then take the one - with the bigger minor number. `2.3.4 > 2.2.4` -* If the patches are numerically different, then take the one with the - bigger patch number. `2.3.4 > 2.3.3` -* If only one of them has a build number, then take the one with the - build number. `2.3.4-0 > 2.3.4` -* If they both have build numbers, and the build numbers are numerically - different, then take the one with the bigger build number. - `2.3.4-10 > 2.3.4-9` -* If only one of them has a tag, then take the one without the tag. - `2.3.4 > 2.3.4-beta` -* If they both have tags, then take the one with the lexicographically - larger tag. `2.3.4-beta > 2.3.4-alpha` -* At this point, they're equal. - ## Ranges The following range styles are supported: +* `1.2.3` A specific version. When nothing else will do. Note that + build metadata is still ignored, so `1.2.3+build2012` will satisfy + this range. * `>1.2.3` Greater than a specific version. -* `<1.2.3` Less than +* `<1.2.3` Less than a specific version. If there is no prerelease + tag on the version range, then no prerelease version will be allowed + either, even though these are technically "less than". +* `>=1.2.3` Greater than or equal to. Note that prerelease versions + are NOT equal to their "normal" equivalents, so `1.2.3-beta` will + not satisfy this range, but `2.3.0-beta` will. +* `<=1.2.3` Less than or equal to. In this case, prerelease versions + ARE allowed, so `1.2.3-beta` would satisfy. * `1.2.3 - 2.3.4` := `>=1.2.3 <=2.3.4` -* `~1.2.3` := `>=1.2.3 <1.3.0` -* `~1.2` := `>=1.2.0 <1.3.0` -* `~1` := `>=1.0.0 <2.0.0` -* `1.2.x` := `>=1.2.0 <1.3.0` -* `1.x` := `>=1.0.0 <2.0.0` +* `~1.2.3` := `>=1.2.3-0 <1.3.0-0` "Reasonably close to 1.2.3". When + using tilde operators, prerelease versions are supported as well, + but a prerelease of the next significant digit will NOT be + satisfactory, so `1.3.0-beta` will not satisfy `~1.2.3`. +* `~1.2` := `>=1.2.0-0 <1.3.0-0` "Any version starting with 1.2" +* `1.2.x` := `>=1.2.0-0 <1.3.0-0` "Any version starting with 1.2" +* `~1` := `>=1.0.0-0 <2.0.0-0` "Any version starting with 1" +* `1.x` := `>=1.0.0-0 <2.0.0-0` "Any version starting with 1" + Ranges can be joined with either a space (which implies "and") or a `||` (which implies "or"). ## Functions +All methods and classes take a final `loose` boolean argument that, if +true, will be more forgiving about not-quite-valid semver strings. +The resulting output will always be 100% strict, of course. + +Strict-mode Comparators and Ranges will be strict about the SemVer +strings that they parse. + * valid(v): Return the parsed version, or null if it's not valid. * inc(v, release): Return the version incremented by the release type (major, minor, patch, or build), or null if it's not valid. |