You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

566 lines
22 KiB

4 years ago
  1. semver(1) -- The semantic versioner for npm
  2. ===========================================
  3. ## Install
  4. ```bash
  5. npm install semver
  6. ````
  7. ## Usage
  8. As a node module:
  9. ```js
  10. const semver = require('semver')
  11. semver.valid('1.2.3') // '1.2.3'
  12. semver.valid('a.b.c') // null
  13. semver.clean(' =v1.2.3 ') // '1.2.3'
  14. semver.satisfies('1.2.3', '1.x || >=2.5.0 || 5.0.0 - 7.2.3') // true
  15. semver.gt('1.2.3', '9.8.7') // false
  16. semver.lt('1.2.3', '9.8.7') // true
  17. semver.minVersion('>=1.0.0') // '1.0.0'
  18. semver.valid(semver.coerce('v2')) // '2.0.0'
  19. semver.valid(semver.coerce('42.6.7.9.3-alpha')) // '42.6.7'
  20. ```
  21. You can also just load the module for the function that you care about, if
  22. you'd like to minimize your footprint.
  23. ```js
  24. // load the whole API at once in a single object
  25. const semver = require('semver')
  26. // or just load the bits you need
  27. // all of them listed here, just pick and choose what you want
  28. // classes
  29. const SemVer = require('semver/classes/semver')
  30. const Comparator = require('semver/classes/comparator')
  31. const Range = require('semver/classes/range')
  32. // functions for working with versions
  33. const semverParse = require('semver/functions/parse')
  34. const semverValid = require('semver/functions/valid')
  35. const semverClean = require('semver/functions/clean')
  36. const semverInc = require('semver/functions/inc')
  37. const semverDiff = require('semver/functions/diff')
  38. const semverMajor = require('semver/functions/major')
  39. const semverMinor = require('semver/functions/minor')
  40. const semverPatch = require('semver/functions/patch')
  41. const semverPrerelease = require('semver/functions/prerelease')
  42. const semverCompare = require('semver/functions/compare')
  43. const semverRcompare = require('semver/functions/rcompare')
  44. const semverCompareLoose = require('semver/functions/compare-loose')
  45. const semverCompareBuild = require('semver/functions/compare-build')
  46. const semverSort = require('semver/functions/sort')
  47. const semverRsort = require('semver/functions/rsort')
  48. // low-level comparators between versions
  49. const semverGt = require('semver/functions/gt')
  50. const semverLt = require('semver/functions/lt')
  51. const semverEq = require('semver/functions/eq')
  52. const semverNeq = require('semver/functions/neq')
  53. const semverGte = require('semver/functions/gte')
  54. const semverLte = require('semver/functions/lte')
  55. const semverCmp = require('semver/functions/cmp')
  56. const semverCoerce = require('semver/functions/coerce')
  57. // working with ranges
  58. const semverSatisfies = require('semver/functions/satisfies')
  59. const semverMaxSatisfying = require('semver/ranges/max-satisfying')
  60. const semverMinSatisfying = require('semver/ranges/min-satisfying')
  61. const semverToComparators = require('semver/ranges/to-comparators')
  62. const semverMinVersion = require('semver/ranges/min-version')
  63. const semverValidRange = require('semver/ranges/valid')
  64. const semverOutside = require('semver/ranges/outside')
  65. const semverGtr = require('semver/ranges/gtr')
  66. const semverLtr = require('semver/ranges/ltr')
  67. const semverIntersects = require('semver/ranges/intersects')
  68. const simplifyRange = require('semver/ranges/simplify')
  69. const rangeSubset = require('semver/ranges/subset')
  70. ```
  71. As a command-line utility:
  72. ```
  73. $ semver -h
  74. A JavaScript implementation of the https://semver.org/ specification
  75. Copyright Isaac Z. Schlueter
  76. Usage: semver [options] <version> [<version> [...]]
  77. Prints valid versions sorted by SemVer precedence
  78. Options:
  79. -r --range <range>
  80. Print versions that match the specified range.
  81. -i --increment [<level>]
  82. Increment a version by the specified level. Level can
  83. be one of: major, minor, patch, premajor, preminor,
  84. prepatch, or prerelease. Default level is 'patch'.
  85. Only one version may be specified.
  86. --preid <identifier>
  87. Identifier to be used to prefix premajor, preminor,
  88. prepatch or prerelease version increments.
  89. -l --loose
  90. Interpret versions and ranges loosely
  91. -p --include-prerelease
  92. Always include prerelease versions in range matching
  93. -c --coerce
  94. Coerce a string into SemVer if possible
  95. (does not imply --loose)
  96. --rtl
  97. Coerce version strings right to left
  98. --ltr
  99. Coerce version strings left to right (default)
  100. Program exits successfully if any valid version satisfies
  101. all supplied ranges, and prints all satisfying versions.
  102. If no satisfying versions are found, then exits failure.
  103. Versions are printed in ascending order, so supplying
  104. multiple versions to the utility will just sort them.
  105. ```
  106. ## Versions
  107. A "version" is described by the `v2.0.0` specification found at
  108. <https://semver.org/>.
  109. A leading `"="` or `"v"` character is stripped off and ignored.
  110. ## Ranges
  111. A `version range` is a set of `comparators` which specify versions
  112. that satisfy the range.
  113. A `comparator` is composed of an `operator` and a `version`. The set
  114. of primitive `operators` is:
  115. * `<` Less than
  116. * `<=` Less than or equal to
  117. * `>` Greater than
  118. * `>=` Greater than or equal to
  119. * `=` Equal. If no operator is specified, then equality is assumed,
  120. so this operator is optional, but MAY be included.
  121. For example, the comparator `>=1.2.7` would match the versions
  122. `1.2.7`, `1.2.8`, `2.5.3`, and `1.3.9`, but not the versions `1.2.6`
  123. or `1.1.0`.
  124. Comparators can be joined by whitespace to form a `comparator set`,
  125. which is satisfied by the **intersection** of all of the comparators
  126. it includes.
  127. A range is composed of one or more comparator sets, joined by `||`. A
  128. version matches a range if and only if every comparator in at least
  129. one of the `||`-separated comparator sets is satisfied by the version.
  130. For example, the range `>=1.2.7 <1.3.0` would match the versions
  131. `1.2.7`, `1.2.8`, and `1.2.99`, but not the versions `1.2.6`, `1.3.0`,
  132. or `1.1.0`.
  133. The range `1.2.7 || >=1.2.9 <2.0.0` would match the versions `1.2.7`,
  134. `1.2.9`, and `1.4.6`, but not the versions `1.2.8` or `2.0.0`.
  135. ### Prerelease Tags
  136. If a version has a prerelease tag (for example, `1.2.3-alpha.3`) then
  137. it will only be allowed to satisfy comparator sets if at least one
  138. comparator with the same `[major, minor, patch]` tuple also has a
  139. prerelease tag.
  140. For example, the range `>1.2.3-alpha.3` would be allowed to match the
  141. version `1.2.3-alpha.7`, but it would *not* be satisfied by
  142. `3.4.5-alpha.9`, even though `3.4.5-alpha.9` is technically "greater
  143. than" `1.2.3-alpha.3` according to the SemVer sort rules. The version
  144. range only accepts prerelease tags on the `1.2.3` version. The
  145. version `3.4.5` *would* satisfy the range, because it does not have a
  146. prerelease flag, and `3.4.5` is greater than `1.2.3-alpha.7`.
  147. The purpose for this behavior is twofold. First, prerelease versions
  148. frequently are updated very quickly, and contain many breaking changes
  149. that are (by the author's design) not yet fit for public consumption.
  150. Therefore, by default, they are excluded from range matching
  151. semantics.
  152. Second, a user who has opted into using a prerelease version has
  153. clearly indicated the intent to use *that specific* set of
  154. alpha/beta/rc versions. By including a prerelease tag in the range,
  155. the user is indicating that they are aware of the risk. However, it
  156. is still not appropriate to assume that they have opted into taking a
  157. similar risk on the *next* set of prerelease versions.
  158. Note that this behavior can be suppressed (treating all prerelease
  159. versions as if they were normal versions, for the purpose of range
  160. matching) by setting the `includePrerelease` flag on the options
  161. object to any
  162. [functions](https://github.com/npm/node-semver#functions) that do
  163. range matching.
  164. #### Prerelease Identifiers
  165. The method `.inc` takes an additional `identifier` string argument that
  166. will append the value of the string as a prerelease identifier:
  167. ```javascript
  168. semver.inc('1.2.3', 'prerelease', 'beta')
  169. // '1.2.4-beta.0'
  170. ```
  171. command-line example:
  172. ```bash
  173. $ semver 1.2.3 -i prerelease --preid beta
  174. 1.2.4-beta.0
  175. ```
  176. Which then can be used to increment further:
  177. ```bash
  178. $ semver 1.2.4-beta.0 -i prerelease
  179. 1.2.4-beta.1
  180. ```
  181. ### Advanced Range Syntax
  182. Advanced range syntax desugars to primitive comparators in
  183. deterministic ways.
  184. Advanced ranges may be combined in the same way as primitive
  185. comparators using white space or `||`.
  186. #### Hyphen Ranges `X.Y.Z - A.B.C`
  187. Specifies an inclusive set.
  188. * `1.2.3 - 2.3.4` := `>=1.2.3 <=2.3.4`
  189. If a partial version is provided as the first version in the inclusive
  190. range, then the missing pieces are replaced with zeroes.
  191. * `1.2 - 2.3.4` := `>=1.2.0 <=2.3.4`
  192. If a partial version is provided as the second version in the
  193. inclusive range, then all versions that start with the supplied parts
  194. of the tuple are accepted, but nothing that would be greater than the
  195. provided tuple parts.
  196. * `1.2.3 - 2.3` := `>=1.2.3 <2.4.0-0`
  197. * `1.2.3 - 2` := `>=1.2.3 <3.0.0-0`
  198. #### X-Ranges `1.2.x` `1.X` `1.2.*` `*`
  199. Any of `X`, `x`, or `*` may be used to "stand in" for one of the
  200. numeric values in the `[major, minor, patch]` tuple.
  201. * `*` := `>=0.0.0` (Any version satisfies)
  202. * `1.x` := `>=1.0.0 <2.0.0-0` (Matching major version)
  203. * `1.2.x` := `>=1.2.0 <1.3.0-0` (Matching major and minor versions)
  204. A partial version range is treated as an X-Range, so the special
  205. character is in fact optional.
  206. * `""` (empty string) := `*` := `>=0.0.0`
  207. * `1` := `1.x.x` := `>=1.0.0 <2.0.0-0`
  208. * `1.2` := `1.2.x` := `>=1.2.0 <1.3.0-0`
  209. #### Tilde Ranges `~1.2.3` `~1.2` `~1`
  210. Allows patch-level changes if a minor version is specified on the
  211. comparator. Allows minor-level changes if not.
  212. * `~1.2.3` := `>=1.2.3 <1.(2+1).0` := `>=1.2.3 <1.3.0-0`
  213. * `~1.2` := `>=1.2.0 <1.(2+1).0` := `>=1.2.0 <1.3.0-0` (Same as `1.2.x`)
  214. * `~1` := `>=1.0.0 <(1+1).0.0` := `>=1.0.0 <2.0.0-0` (Same as `1.x`)
  215. * `~0.2.3` := `>=0.2.3 <0.(2+1).0` := `>=0.2.3 <0.3.0-0`
  216. * `~0.2` := `>=0.2.0 <0.(2+1).0` := `>=0.2.0 <0.3.0-0` (Same as `0.2.x`)
  217. * `~0` := `>=0.0.0 <(0+1).0.0` := `>=0.0.0 <1.0.0-0` (Same as `0.x`)
  218. * `~1.2.3-beta.2` := `>=1.2.3-beta.2 <1.3.0-0` Note that prereleases in
  219. the `1.2.3` version will be allowed, if they are greater than or
  220. equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but
  221. `1.2.4-beta.2` would not, because it is a prerelease of a
  222. different `[major, minor, patch]` tuple.
  223. #### Caret Ranges `^1.2.3` `^0.2.5` `^0.0.4`
  224. Allows changes that do not modify the left-most non-zero element in the
  225. `[major, minor, patch]` tuple. In other words, this allows patch and
  226. minor updates for versions `1.0.0` and above, patch updates for
  227. versions `0.X >=0.1.0`, and *no* updates for versions `0.0.X`.
  228. Many authors treat a `0.x` version as if the `x` were the major
  229. "breaking-change" indicator.
  230. Caret ranges are ideal when an author may make breaking changes
  231. between `0.2.4` and `0.3.0` releases, which is a common practice.
  232. However, it presumes that there will *not* be breaking changes between
  233. `0.2.4` and `0.2.5`. It allows for changes that are presumed to be
  234. additive (but non-breaking), according to commonly observed practices.
  235. * `^1.2.3` := `>=1.2.3 <2.0.0-0`
  236. * `^0.2.3` := `>=0.2.3 <0.3.0-0`
  237. * `^0.0.3` := `>=0.0.3 <0.0.4-0`
  238. * `^1.2.3-beta.2` := `>=1.2.3-beta.2 <2.0.0-0` Note that prereleases in
  239. the `1.2.3` version will be allowed, if they are greater than or
  240. equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but
  241. `1.2.4-beta.2` would not, because it is a prerelease of a
  242. different `[major, minor, patch]` tuple.
  243. * `^0.0.3-beta` := `>=0.0.3-beta <0.0.4-0` Note that prereleases in the
  244. `0.0.3` version *only* will be allowed, if they are greater than or
  245. equal to `beta`. So, `0.0.3-pr.2` would be allowed.
  246. When parsing caret ranges, a missing `patch` value desugars to the
  247. number `0`, but will allow flexibility within that value, even if the
  248. major and minor versions are both `0`.
  249. * `^1.2.x` := `>=1.2.0 <2.0.0-0`
  250. * `^0.0.x` := `>=0.0.0 <0.1.0-0`
  251. * `^0.0` := `>=0.0.0 <0.1.0-0`
  252. A missing `minor` and `patch` values will desugar to zero, but also
  253. allow flexibility within those values, even if the major version is
  254. zero.
  255. * `^1.x` := `>=1.0.0 <2.0.0-0`
  256. * `^0.x` := `>=0.0.0 <1.0.0-0`
  257. ### Range Grammar
  258. Putting all this together, here is a Backus-Naur grammar for ranges,
  259. for the benefit of parser authors:
  260. ```bnf
  261. range-set ::= range ( logical-or range ) *
  262. logical-or ::= ( ' ' ) * '||' ( ' ' ) *
  263. range ::= hyphen | simple ( ' ' simple ) * | ''
  264. hyphen ::= partial ' - ' partial
  265. simple ::= primitive | partial | tilde | caret
  266. primitive ::= ( '<' | '>' | '>=' | '<=' | '=' ) partial
  267. partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )?
  268. xr ::= 'x' | 'X' | '*' | nr
  269. nr ::= '0' | ['1'-'9'] ( ['0'-'9'] ) *
  270. tilde ::= '~' partial
  271. caret ::= '^' partial
  272. qualifier ::= ( '-' pre )? ( '+' build )?
  273. pre ::= parts
  274. build ::= parts
  275. parts ::= part ( '.' part ) *
  276. part ::= nr | [-0-9A-Za-z]+
  277. ```
  278. ## Functions
  279. All methods and classes take a final `options` object argument. All
  280. options in this object are `false` by default. The options supported
  281. are:
  282. - `loose` Be more forgiving about not-quite-valid semver strings.
  283. (Any resulting output will always be 100% strict compliant, of
  284. course.) For backwards compatibility reasons, if the `options`
  285. argument is a boolean value instead of an object, it is interpreted
  286. to be the `loose` param.
  287. - `includePrerelease` Set to suppress the [default
  288. behavior](https://github.com/npm/node-semver#prerelease-tags) of
  289. excluding prerelease tagged versions from ranges unless they are
  290. explicitly opted into.
  291. Strict-mode Comparators and Ranges will be strict about the SemVer
  292. strings that they parse.
  293. * `valid(v)`: Return the parsed version, or null if it's not valid.
  294. * `inc(v, release)`: Return the version incremented by the release
  295. type (`major`, `premajor`, `minor`, `preminor`, `patch`,
  296. `prepatch`, or `prerelease`), or null if it's not valid
  297. * `premajor` in one call will bump the version up to the next major
  298. version and down to a prerelease of that major version.
  299. `preminor`, and `prepatch` work the same way.
  300. * If called from a non-prerelease version, the `prerelease` will work the
  301. same as `prepatch`. It increments the patch version, then makes a
  302. prerelease. If the input version is already a prerelease it simply
  303. increments it.
  304. * `prerelease(v)`: Returns an array of prerelease components, or null
  305. if none exist. Example: `prerelease('1.2.3-alpha.1') -> ['alpha', 1]`
  306. * `major(v)`: Return the major version number.
  307. * `minor(v)`: Return the minor version number.
  308. * `patch(v)`: Return the patch version number.
  309. * `intersects(r1, r2, loose)`: Return true if the two supplied ranges
  310. or comparators intersect.
  311. * `parse(v)`: Attempt to parse a string as a semantic version, returning either
  312. a `SemVer` object or `null`.
  313. ### Comparison
  314. * `gt(v1, v2)`: `v1 > v2`
  315. * `gte(v1, v2)`: `v1 >= v2`
  316. * `lt(v1, v2)`: `v1 < v2`
  317. * `lte(v1, v2)`: `v1 <= v2`
  318. * `eq(v1, v2)`: `v1 == v2` This is true if they're logically equivalent,
  319. even if they're not the exact same string. You already know how to
  320. compare strings.
  321. * `neq(v1, v2)`: `v1 != v2` The opposite of `eq`.
  322. * `cmp(v1, comparator, v2)`: Pass in a comparison string, and it'll call
  323. the corresponding function above. `"==="` and `"!=="` do simple
  324. string comparison, but are included for completeness. Throws if an
  325. invalid comparison string is provided.
  326. * `compare(v1, v2)`: Return `0` if `v1 == v2`, or `1` if `v1` is greater, or `-1` if
  327. `v2` is greater. Sorts in ascending order if passed to `Array.sort()`.
  328. * `rcompare(v1, v2)`: The reverse of compare. Sorts an array of versions
  329. in descending order when passed to `Array.sort()`.
  330. * `compareBuild(v1, v2)`: The same as `compare` but considers `build` when two versions
  331. are equal. Sorts in ascending order if passed to `Array.sort()`.
  332. `v2` is greater. Sorts in ascending order if passed to `Array.sort()`.
  333. * `diff(v1, v2)`: Returns difference between two versions by the release type
  334. (`major`, `premajor`, `minor`, `preminor`, `patch`, `prepatch`, or `prerelease`),
  335. or null if the versions are the same.
  336. ### Comparators
  337. * `intersects(comparator)`: Return true if the comparators intersect
  338. ### Ranges
  339. * `validRange(range)`: Return the valid range or null if it's not valid
  340. * `satisfies(version, range)`: Return true if the version satisfies the
  341. range.
  342. * `maxSatisfying(versions, range)`: Return the highest version in the list
  343. that satisfies the range, or `null` if none of them do.
  344. * `minSatisfying(versions, range)`: Return the lowest version in the list
  345. that satisfies the range, or `null` if none of them do.
  346. * `minVersion(range)`: Return the lowest version that can possibly match
  347. the given range.
  348. * `gtr(version, range)`: Return `true` if version is greater than all the
  349. versions possible in the range.
  350. * `ltr(version, range)`: Return `true` if version is less than all the
  351. versions possible in the range.
  352. * `outside(version, range, hilo)`: Return true if the version is outside
  353. the bounds of the range in either the high or low direction. The
  354. `hilo` argument must be either the string `'>'` or `'<'`. (This is
  355. the function called by `gtr` and `ltr`.)
  356. * `intersects(range)`: Return true if any of the ranges comparators intersect
  357. * `simplifyRange(versions, range)`: Return a "simplified" range that
  358. matches the same items in `versions` list as the range specified. Note
  359. that it does *not* guarantee that it would match the same versions in all
  360. cases, only for the set of versions provided. This is useful when
  361. generating ranges by joining together multiple versions with `||`
  362. programmatically, to provide the user with something a bit more
  363. ergonomic. If the provided range is shorter in string-length than the
  364. generated range, then that is returned.
  365. * `subset(subRange, superRange)`: Return `true` if the `subRange` range is
  366. entirely contained by the `superRange` range.
  367. Note that, since ranges may be non-contiguous, a version might not be
  368. greater than a range, less than a range, *or* satisfy a range! For
  369. example, the range `1.2 <1.2.9 || >2.0.0` would have a hole from `1.2.9`
  370. until `2.0.0`, so the version `1.2.10` would not be greater than the
  371. range (because `2.0.1` satisfies, which is higher), nor less than the
  372. range (since `1.2.8` satisfies, which is lower), and it also does not
  373. satisfy the range.
  374. If you want to know if a version satisfies or does not satisfy a
  375. range, use the `satisfies(version, range)` function.
  376. ### Coercion
  377. * `coerce(version, options)`: Coerces a string to semver if possible
  378. This aims to provide a very forgiving translation of a non-semver string to
  379. semver. It looks for the first digit in a string, and consumes all
  380. remaining characters which satisfy at least a partial semver (e.g., `1`,
  381. `1.2`, `1.2.3`) up to the max permitted length (256 characters). Longer
  382. versions are simply truncated (`4.6.3.9.2-alpha2` becomes `4.6.3`). All
  383. surrounding text is simply ignored (`v3.4 replaces v3.3.1` becomes
  384. `3.4.0`). Only text which lacks digits will fail coercion (`version one`
  385. is not valid). The maximum length for any semver component considered for
  386. coercion is 16 characters; longer components will be ignored
  387. (`10000000000000000.4.7.4` becomes `4.7.4`). The maximum value for any
  388. semver component is `Number.MAX_SAFE_INTEGER || (2**53 - 1)`; higher value
  389. components are invalid (`9999999999999999.4.7.4` is likely invalid).
  390. If the `options.rtl` flag is set, then `coerce` will return the right-most
  391. coercible tuple that does not share an ending index with a longer coercible
  392. tuple. For example, `1.2.3.4` will return `2.3.4` in rtl mode, not
  393. `4.0.0`. `1.2.3/4` will return `4.0.0`, because the `4` is not a part of
  394. any other overlapping SemVer tuple.
  395. ### Clean
  396. * `clean(version)`: Clean a string to be a valid semver if possible
  397. This will return a cleaned and trimmed semver version. If the provided
  398. version is not valid a null will be returned. This does not work for
  399. ranges.
  400. ex.
  401. * `s.clean(' = v 2.1.5foo')`: `null`
  402. * `s.clean(' = v 2.1.5foo', { loose: true })`: `'2.1.5-foo'`
  403. * `s.clean(' = v 2.1.5-foo')`: `null`
  404. * `s.clean(' = v 2.1.5-foo', { loose: true })`: `'2.1.5-foo'`
  405. * `s.clean('=v2.1.5')`: `'2.1.5'`
  406. * `s.clean(' =v2.1.5')`: `2.1.5`
  407. * `s.clean(' 2.1.5 ')`: `'2.1.5'`
  408. * `s.clean('~1.0.0')`: `null`
  409. ## Exported Modules
  410. <!--
  411. TODO: Make sure that all of these items are documented (classes aren't,
  412. eg), and then pull the module name into the documentation for that specific
  413. thing.
  414. -->
  415. You may pull in just the part of this semver utility that you need, if you
  416. are sensitive to packing and tree-shaking concerns. The main
  417. `require('semver')` export uses getter functions to lazily load the parts
  418. of the API that are used.
  419. The following modules are available:
  420. * `require('semver')`
  421. * `require('semver/classes')`
  422. * `require('semver/classes/comparator')`
  423. * `require('semver/classes/range')`
  424. * `require('semver/classes/semver')`
  425. * `require('semver/functions/clean')`
  426. * `require('semver/functions/cmp')`
  427. * `require('semver/functions/coerce')`
  428. * `require('semver/functions/compare')`
  429. * `require('semver/functions/compare-build')`
  430. * `require('semver/functions/compare-loose')`
  431. * `require('semver/functions/diff')`
  432. * `require('semver/functions/eq')`
  433. * `require('semver/functions/gt')`
  434. * `require('semver/functions/gte')`
  435. * `require('semver/functions/inc')`
  436. * `require('semver/functions/lt')`
  437. * `require('semver/functions/lte')`
  438. * `require('semver/functions/major')`
  439. * `require('semver/functions/minor')`
  440. * `require('semver/functions/neq')`
  441. * `require('semver/functions/parse')`
  442. * `require('semver/functions/patch')`
  443. * `require('semver/functions/prerelease')`
  444. * `require('semver/functions/rcompare')`
  445. * `require('semver/functions/rsort')`
  446. * `require('semver/functions/satisfies')`
  447. * `require('semver/functions/sort')`
  448. * `require('semver/functions/valid')`
  449. * `require('semver/ranges/gtr')`
  450. * `require('semver/ranges/intersects')`
  451. * `require('semver/ranges/ltr')`
  452. * `require('semver/ranges/max-satisfying')`
  453. * `require('semver/ranges/min-satisfying')`
  454. * `require('semver/ranges/min-version')`
  455. * `require('semver/ranges/outside')`
  456. * `require('semver/ranges/to-comparators')`
  457. * `require('semver/ranges/valid')`