Check for current Node Version


Question

I need to programmatically access the current node version running in a library I am writing. Can't seem to find this in the docs.

1
114
7/11/2011 8:45:32 PM

Accepted Answer

Try to look at process.version property.

182
7/4/2013 6:23:13 PM

Number(process.version.match(/^v(\d+\.\d+)/)[1])

if process.version is 'v0.11.5', then get 0.11 (Number).


Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow
Icon