To get the operating system name in TypeScript, you can use the following code snippet in Node.js:
index.ts116 chars5 lines
The hostname()
method from Node.js built-in os
module returns the operating system hostname. This method returns a string that represents the hostname of the operating system the Node.js process is running on.
gistlibby LogSnag