doc: provide more guidance about process.version

PR-URL: https://github.com/nodejs/node/pull/34909
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
This commit is contained in:
Rich Trott authored and Richard Lau committed 2020-09-01 11:15:49 -04:00
1 parent 4782ec7b3b
commit fbd18be459
1 file changed
+5 -2
+5 -2
View File
@@ -2476,13 +2476,16 @@ added: v0.1.3
* {string}
The `process.version` property returns the Node.js version string in the form of
`v<major>.<minor>.<patch>`.
The `process.version` property contains the Node.js version string.
```js
console.log(`Version: ${process.version}`);
// Version: v14.8.0
```
To get the version string without the prepended _v_, use
`process.versions.node`.
## `process.versions`
<!-- YAML
added: v0.2.0