Skip to content

Commit 5f0064d

Browse files
committedJul 11, 2019
doc: update semver documentation
1 parent 9a693d0 commit 5f0064d

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed
 

‎doc/misc/semver.md

+14-2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ semver.clean(' =v1.2.3 ') // '1.2.3'
2020
semver.satisfies('1.2.3', '1.x || >=2.5.0 || 5.0.0 - 7.2.3') // true
2121
semver.gt('1.2.3', '9.8.7') // false
2222
semver.lt('1.2.3', '9.8.7') // true
23+
semver.minVersion('>=1.0.0') // '1.0.0'
2324
semver.valid(semver.coerce('v2')) // '2.0.0'
2425
semver.valid(semver.coerce('42.6.7.9.3-alpha')) // '42.6.7'
2526
```
@@ -29,7 +30,7 @@ As a command-line utility:
2930
```
3031
$ semver -h
3132

32-
A JavaScript implementation of the http://semver.org/ specification
33+
A JavaScript implementation of the https://semver.org/ specification
3334
Copyright Isaac Z. Schlueter
3435

3536
Usage: semver [options] <version> [<version> [...]]
@@ -71,7 +72,7 @@ multiple versions to the utility will just sort them.
7172
## Versions
7273
7374
A "version" is described by the `v2.0.0` specification found at
74-
<http://semver.org/>.
75+
<https://semver.org/>.
7576
7677
A leading `"="` or `"v"` character is stripped off and ignored.
7778
@@ -137,6 +138,13 @@ the user is indicating that they are aware of the risk. However, it
137138
is still not appropriate to assume that they have opted into taking a
138139
similar risk on the *next* set of prerelease versions.
139140
141+
Note that this behavior can be suppressed (treating all prerelease
142+
versions as if they were normal versions, for the purpose of range
143+
matching) by setting the `includePrerelease` flag on the options
144+
object to any
145+
[functions](https://github.com/npm/node-semver#functions) that do
146+
range matching.
147+
140148
#### Prerelease Identifiers
141149
142150
The method `.inc` takes an additional `identifier` string argument that
@@ -325,6 +333,8 @@ strings that they parse.
325333
* `patch(v)`: Return the patch version number.
326334
* `intersects(r1, r2, loose)`: Return true if the two supplied ranges
327335
or comparators intersect.
336+
* `parse(v)`: Attempt to parse a string as a semantic version, returning either
337+
a `SemVer` object or `null`.
328338

329339
### Comparison
330340

@@ -361,6 +371,8 @@ strings that they parse.
361371
that satisfies the range, or `null` if none of them do.
362372
* `minSatisfying(versions, range)`: Return the lowest version in the list
363373
that satisfies the range, or `null` if none of them do.
374+
* `minVersion(range)`: Return the lowest version that can possibly match
375+
the given range.
364376
* `gtr(version, range)`: Return `true` if version is greater than all the
365377
versions possible in the range.
366378
* `ltr(version, range)`: Return `true` if version is less than all the

0 commit comments

Comments
 (0)
Please sign in to comment.