Node.js Snippet - Checking Version in Code

Skill

Node.js Snippet - Checking Version in Code

Posted in:

Here's the problem: How do I check the version of node from inside the running app? Fortunately, the answer is easy. Node's global process object has a version property that contains all the info you'll need.

console.log(process.version);

// v0.8.5

Add Comment

Put code snippets inside language tags:
[language] [/language]

Examples:
[javascript] [/javascript]
[actionscript] [/actionscript]
[csharp] [/csharp]

See here for supported languages.

Javascript must be enabled to submit anonymous comments - or you can login.
CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.