Is there a way to know what Windows version is running in NodeJS?

I have an scenario where I need to know if I'm running Windows 8.1 (and not any other Windows version), using Node JS. Is there a way to figure out this information?

Thanks in advance.

You can use the os module:

var os = require('os');

os.platform();
os.release();

For Windows os.platform() returns win32, so you can use:

if (os.platform() === 'win32') {
  console.log(os.release());
}