I would like to know the current version of Node, such as the one obtained by the command line "node -v", but via a js function.
Asked
Active
Viewed 62 times
1 Answers
2
The NodeJS global object property process.version might be what you need.

Gaëtan Boyals
- 1,193
- 1
- 7
- 22
-
A global object property, not a function, but yes, that's the way. – pawel Jun 16 '21 at 09:03
-
@pawel oops my bad, I'll edit! – Gaëtan Boyals Jun 16 '21 at 09:07
-
Thank you for your reply! variable or function, it suits me ... – Didier68 Jun 16 '21 at 09:13
-
There is also https://nodejs.org/docs/latest-v14.x/api/process.html#process_process_versions – Didier68 Jun 16 '21 at 14:21