OS information
If you need to retrieve information about the Operating System, like the version, the release, the platform, the release, you can use some functions implemented by the os
module.
The Operating System version: os.version()
The os
module has the version()
method to return the version of the Operating System in use.
The version()
method returns a string with the full name of the Operating System version, like this:
The Operating System platform: os.platform()
The os
module has the platform()
function to return the name of the platform of the Operating System in use.
The platform()
method returns a string with the name of the platform Operating System version, like for example: aix
, android
, darwin
, freebsd
,linux
, openbsd
, sunos
, or win32
.
If you are running Node on a Mac OS machine, you will obtain darwin
.