bestiejs / platform.js

A platform detection library.
https://mths.be/platform
MIT License
3.22k stars 408 forks source link

Fallback to "os" module on Node.js #118

Open bennycode opened 7 years ago

bennycode commented 7 years ago

I am using platform in a Node.js module on a Windows 10 computer.

Doing this I noticed, that platform cannot recognize the version number of my Windows installation (which is 10.0.14393). But platform knows, that it is running inside a Node.js application. In such a case it could fallback to Node's "os" module (which is available with Node v6+) to get my Windows version.

Showcase with platform:

var platform = require('platform');
console.log(platform.os.version); // null

Showcase with os (comes with Node.js):

var os = require('os');
console.log(os.release()); // "10.0.14393"