![]() |
VOOZH | about |
The process.platform property is an inbuilt application programming interface of the process module which is used to get the Operating System platform information.
Syntax:
process.platform
Return Value: This property returns a string that represents the operating system platform. The returned value can be one of these 'aix', 'android', 'darwin', 'freebsd', 'linux', 'openbsd', 'sunprocess', and 'win32'. This values is set at compile time.
Below examples illustrate the use of process.platform property in Node.js:
Example 1:
Output:
win32
Example 2:
Output:
windows platform
Note: The above program will compile and run by using the node filename.js command.
Reference: https://nodejs.org/api/process.html#process_process_platform