summaryrefslogtreecommitdiff
path: root/doc/api/process.md
diff options
context:
space:
mode:
authorGus Caplan <me@gus.host>2018-03-24 23:57:23 -0500
committerGus Caplan <me@gus.host>2018-04-13 22:03:04 -0700
commit91e0f8db118b125e805a77ce31dc21af57ee7abf (patch)
treebb1e422c0b121b90cc0988af4cf351d1b024f8e3 /doc/api/process.md
parenta43e8896f2c252ef30b4da08402badbe3a17124f (diff)
downloadandroid-node-v8-91e0f8db118b125e805a77ce31dc21af57ee7abf.tar.gz
android-node-v8-91e0f8db118b125e805a77ce31dc21af57ee7abf.tar.bz2
android-node-v8-91e0f8db118b125e805a77ce31dc21af57ee7abf.zip
process: add version constants and compare
PR-URL: https://github.com/nodejs/node/pull/19587 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Diffstat (limited to 'doc/api/process.md')
-rw-r--r--doc/api/process.md34
1 files changed, 31 insertions, 3 deletions
diff --git a/doc/api/process.md b/doc/api/process.md
index 202725cb51..060d741804 100644
--- a/doc/api/process.md
+++ b/doc/api/process.md
@@ -1482,6 +1482,9 @@ changes:
- version: v4.2.0
pr-url: https://github.com/nodejs/node/pull/3212
description: The `lts` property is now supported.
+ - version: REPLACEME
+ pr-url: https://github.com/nodejs/node/pull/19587
+ description: Add SemVer properties.
-->
* {Object}
@@ -1510,6 +1513,10 @@ tarball.
- `'Argon'` for the 4.x LTS line beginning with 4.2.0.
- `'Boron'` for the 6.x LTS line beginning with 6.9.0.
- `'Carbon'` for the 8.x LTS line beginning with 8.9.1.
+* `majorVersion` {number} The major version of this release.
+* `minorVersion` {number} The minor version of this release.
+* `patchVersion` {number} The patch version of this release.
+* `prereleaseTag` {string} The SemVer pre-release tag for Node.js.
<!-- eslint-skip -->
```js
@@ -1518,13 +1525,34 @@ tarball.
lts: 'Argon',
sourceUrl: 'https://nodejs.org/download/release/v4.4.5/node-v4.4.5.tar.gz',
headersUrl: 'https://nodejs.org/download/release/v4.4.5/node-v4.4.5-headers.tar.gz',
- libUrl: 'https://nodejs.org/download/release/v4.4.5/win-x64/node.lib'
+ libUrl: 'https://nodejs.org/download/release/v4.4.5/win-x64/node.lib',
+ majorVersion: 4,
+ minorVersion: 4,
+ patchVersion: 5,
+ prereleaseTag: '',
+ compareVersion: [Function: compareVersion]
}
```
+
In custom builds from non-release versions of the source tree, only the
-`name` property may be present. The additional properties should not be
-relied upon to exist.
+`name` property and SemVer properties may be present. The additional properties
+should not be relied upon to exist.
+
+## process.release.compareVersion(major, minor, patch[, tag])
+<!-- YAML
+added: REPLACEME
+-->
+
+Perform a SemVer comparison to the release version.
+
+* `major` {number} The major version to compare.
+* `minor` {number} The minor version to compare.
+* `patch` {number} The patch version to compare.
+* `tag` {string} The pre-release tag to compare.
+* Returns: {number} `1` if the given version is lower than the current release
+ version, `0` if the given version matches the process version, and `-1`
+ if the given version is greater than the release version.
## process.send(message[, sendHandle[, options]][, callback])
<!-- YAML