How to get Windows version using Node.js?

后端 未结 3 1457
栀梦
栀梦 2020-12-21 23:01

There are questions about OS version on the Stack Overflow but not about the Windows name, I am looking to find out Windows name using Node.js.

I have looked into so

3条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-21 23:23

    var os = require('os');
    console.log(os.type());
    

    refer to this link for more references: https://millermedeiros.github.io/mdoc/examples/node_api/doc/os.html

    The other alternative can be the npm library : "platform"

    check this out: https://www.npmjs.com/package/platform

提交回复
热议问题