Languages
[Edit]
EN

Node.js - detect operating system name (Windows, Linux, macOS)

8 points
Created by:
Krzysiek
741

In this short article, we would like to show how to detect used operating system in Node.js application.

Quick solution:

 

Reusable function

Edit

In this section, you can find function that lets in simple way to detect normalised operating system name omitting details, e.g. NT postfix for Windows, etc.

 

Alternative solution

Edit

Node.js API provides information about platform that helps in easy way to detect operating system.

 

References

Edit
  1. Node.js process.platform - API Docs

Alternative titles

  1. Node.js - detect operating system type (Windows, Linux, macOS)
  2. Node.js - detect OS type (Windows, Linux, macOS)
1
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join