diff options
author | Kat Marchán <kzm@sykosomatic.org> | 2016-09-08 04:34:19 +0300 |
---|---|---|
committer | Kat Marchán <kzm@sykosomatic.org> | 2016-09-09 03:05:55 +0300 |
commit | 80540c52b252615ae8a6271b3df870eabfea935e (patch) | |
tree | 35e62e95868ba3b77886aabe80423fec28a77fbf /node_modules/semver/README.md | |
parent | 855c099482a8d93b7f0646bd7bcf8a31f81868e0 (diff) |
semver@5.3.0
* add
* add
* remove test files from distribution
* doc and style updates
Credit: @isaacs
Diffstat (limited to 'node_modules/semver/README.md')
-rw-r--r-- | node_modules/semver/README.md | 39 |
1 files changed, 31 insertions, 8 deletions
diff --git a/node_modules/semver/README.md b/node_modules/semver/README.md index 0b14a7e81..cbd956549 100644 --- a/node_modules/semver/README.md +++ b/node_modules/semver/README.md @@ -4,6 +4,8 @@ semver(1) -- The semantic versioner for npm ## Usage $ npm install semver + $ node + var semver = require('semver') semver.valid('1.2.3') // '1.2.3' semver.valid('a.b.c') // null @@ -16,18 +18,35 @@ As a command-line utility: $ semver -h - Usage: semver <version> [<version> [...]] [-r <range> | -i <inc> | --preid <identifier> | -l | -rv] - Test if version(s) satisfy the supplied range(s), and sort them. + SemVer 5.1.0 - Multiple versions or ranges may be supplied, unless increment - option is specified. In that case, only a single version may - be used, and it is incremented by the specified level + A JavaScript implementation of the http://semver.org/ specification + Copyright Isaac Z. Schlueter + + Usage: semver [options] <version> [<version> [...]] + Prints valid versions sorted by SemVer precedence + + Options: + -r --range <range> + Print versions that match the specified range. + + -i --increment [<level>] + Increment a version by the specified level. Level can + be one of: major, minor, patch, premajor, preminor, + prepatch, or prerelease. Default level is 'patch'. + Only one version may be specified. + + --preid <identifier> + Identifier to be used to prefix premajor, preminor, + prepatch or prerelease version increments. + + -l --loose + Interpret versions and ranges loosely Program exits successfully if any valid version satisfies all supplied ranges, and prints all satisfying versions. - If no versions are valid, or ranges are not satisfied, - then exits failure. + If no satisfying versions are found, then exits failure. Versions are printed in ascending order, so supplying multiple versions to the utility will just sort them. @@ -242,7 +261,7 @@ simple ::= primitive | partial | tilde | caret primitive ::= ( '<' | '>' | '>=' | '<=' | '=' | ) partial partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )? xr ::= 'x' | 'X' | '*' | nr -nr ::= '0' | ['1'-'9']['0'-'9']+ +nr ::= '0' | ['1'-'9'] ( ['0'-'9'] ) * tilde ::= '~' partial caret ::= '^' partial qualifier ::= ( '-' pre )? ( '+' build )? @@ -272,6 +291,8 @@ strings that they parse. same as `prepatch`. It increments the patch version, then makes a prerelease. If the input version is already a prerelease it simply increments it. +* `prerelease(v)`: Returns an array of prerelease components, or null + if none exist. Example: `prerelease('1.2.3-alpha.1') -> ['alpha', 1]` * `major(v)`: Return the major version number. * `minor(v)`: Return the minor version number. * `patch(v)`: Return the patch version number. @@ -306,6 +327,8 @@ strings that they parse. range. * `maxSatisfying(versions, range)`: Return the highest version in the list that satisfies the range, or `null` if none of them do. +* `minSatisfying(versions, range)`: Return the lowest version in the list + that satisfies the range, or `null` if none of them do. * `gtr(version, range)`: Return `true` if version is greater than all the versions possible in the range. * `ltr(version, range)`: Return `true` if version is less than all the |