Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

doc: Update docs for os.platform() #25777

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion doc/api/os.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,25 @@ Returns the operating system name.

## os.platform()

Returns the operating system platform.
Returns the operating system platform. Some of the possible values are
`"linux"`, `"darwin"`, `"win32"`, `"sunos"` ...

Its value is based on [`OS` constant of `gyp`](https://chromium.googlesource.com/external/gyp/+/HEAD/docs/InputFormatReference.md#Predefined-Variables)
, but with exceptions in case of Mac OS X, Windows and Solaris.

On Windows its value is always `"win32"`, on Mac OS X its `"darwin"` and on
Solaris its `"sunos"`.

Heres a list of possible values for some platforms:

* Android: `"android"`
* Windows/Cygwin: `"win32"`
* Mac OS X: `"darwin"`
* FreeBSD: `"freebsd"`
* OpenBSD: `"openbsd"`
* IBM AIX: `"aix"`
* Solaris: `"sunos"`
* Linux & Others: `"linux"`

## os.arch()

Expand Down