Skip to content

Commit

Permalink
Update docs for os.platform()
Browse files Browse the repository at this point in the history
- made the copy changes @sam-github suggested
- updated the documentation link as the original was broken

references nodejs#2446
  • Loading branch information
mark hughes committed Dec 1, 2016
1 parent d061dde commit 71e2624
Showing 1 changed file with 19 additions and 11 deletions.
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 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"`

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

Expand Down

0 comments on commit 71e2624

Please sign in to comment.