Skip to content
Closed
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Update docs for os.platform()
* references closed #2446
* updates broken documentation link
* fixes copy based on comments from @sam-github
  • Loading branch information
mark hughes committed Dec 1, 2016
commit a0070b5fbc9eda185e60ffa45ac6a4452486a784
30 changes: 19 additions & 11 deletions doc/api/os.md
Original file line number Diff line number Diff line change
Expand Up @@ -293,17 +293,25 @@ added: v0.5.0
* Returns: {String}

The `os.platform()` method returns a string identifying the operating system
platform as set during compile time of Node.js.

Currently possible values are:

* `'aix'`
* `'darwin'`
* `'freebsd'`
* `'linux'`
* `'openbsd'`
* `'sunos'`
* `'win32'`
platform as set during compile time of Node.js. 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/+/md-pages/docs/InputFormatReference.md#Predefined-Variables)
, but with exceptions in case of Mac OS X, Windows and Solaris.

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

Here is a list of possible values for some platforms:

* Android: `"android"`
* Windows/Cygwin: `"win32"`
* Mac OS X: `"darwin"`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the proper branding here is macOS

* FreeBSD: `"freebsd"`
* OpenBSD: `"openbsd"`
* IBM AIX: `"aix"`
* Solaris: `"sunos"`
* Linux & Others: `"linux"`

Equivalent to [`process.platform`][].

Expand Down