Skip to content

Commit 4a91fa1

Browse files
hertzgjasnell
authored andcommitted
doc: Update docs for os.platform()
Specifies origin and includes a list of possible values PR-URL: nodejs/node-v0.x-archive#25777 Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 15030f2 commit 4a91fa1

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

doc/api/os.markdown

+19-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,25 @@ Returns the operating system name.
2424

2525
## os.platform()
2626

27-
Returns the operating system platform.
27+
Returns the operating system platform. Some of the possible values are
28+
`"linux"`, `"darwin"`, `"win32"`, `"sunos"` ...
29+
30+
Its value is based on [`OS` constant of `gyp`](https://chromium.googlesource.com/external/gyp/+/HEAD/docs/InputFormatReference.md#Predefined-Variables)
31+
, but with exceptions in case of Mac OS X, Windows and Solaris.
32+
33+
On Windows its value is always `"win32"`, on Mac OS X its `"darwin"` and on
34+
Solaris its `"sunos"`.
35+
36+
Heres a list of possible values for some platforms:
37+
38+
* Android: `"android"`
39+
* Windows/Cygwin: `"win32"`
40+
* Mac OS X: `"darwin"`
41+
* FreeBSD: `"freebsd"`
42+
* OpenBSD: `"openbsd"`
43+
* IBM AIX: `"aix"`
44+
* Solaris: `"sunos"`
45+
* Linux & Others: `"linux"`
2846

2947
## os.arch()
3048

0 commit comments

Comments
 (0)