Skip to content

Commit a0070b5

Browse files
author
mark hughes
committed
Update docs for os.platform()
* references closed nodejs#2446 * updates broken documentation link * fixes copy based on comments from @sam-github
1 parent d061dde commit a0070b5

1 file changed

Lines changed: 19 additions & 11 deletions

File tree

doc/api/os.md

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -293,17 +293,25 @@ added: v0.5.0
293293
* Returns: {String}
294294

295295
The `os.platform()` method returns a string identifying the operating system
296-
platform as set during compile time of Node.js.
297-
298-
Currently possible values are:
299-
300-
* `'aix'`
301-
* `'darwin'`
302-
* `'freebsd'`
303-
* `'linux'`
304-
* `'openbsd'`
305-
* `'sunos'`
306-
* `'win32'`
296+
platform as set during compile time of Node.js. Some of the possible values are
297+
`"linux"`, `"darwin"`, `"win32"`, `"sunos"` ...
298+
299+
Its value is based on [`OS` constant of `gyp`](https://chromium.googlesource.com/external/gyp/+/md-pages/docs/InputFormatReference.md#Predefined-Variables)
300+
, but with exceptions in case of Mac OS X, Windows and Solaris.
301+
302+
On Windows it's value is always `"win32"`, on Mac OS X it's `"darwin"` and on
303+
Solaris it is `"sunos"`.
304+
305+
Here is a list of possible values for some platforms:
306+
307+
* Android: `"android"`
308+
* Windows/Cygwin: `"win32"`
309+
* Mac OS X: `"darwin"`
310+
* FreeBSD: `"freebsd"`
311+
* OpenBSD: `"openbsd"`
312+
* IBM AIX: `"aix"`
313+
* Solaris: `"sunos"`
314+
* Linux & Others: `"linux"`
307315

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

0 commit comments

Comments
 (0)