-
Notifications
You must be signed in to change notification settings - Fork 29.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
doc: Update docs for os.platform() #2446
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -30,10 +30,26 @@ on OS X and `'Windows_NT'` on Windows. | |||||||||||||
|
||||||||||||||
## os.platform() | ||||||||||||||
|
||||||||||||||
Returns the operating system platform. Possible values are `'darwin'`, | ||||||||||||||
`'freebsd'`, `'linux'`, `'sunos'` or `'win32'`. Returns the value of | ||||||||||||||
Returns the operating system platform. Returns the value of | ||||||||||||||
`process.platform`. | ||||||||||||||
|
||||||||||||||
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. | ||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This reference isn't useful, please remove. Its not useful because following the link doesn't actually lead to a list of platform values, and of the 3 example values, two are wrong. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There's no defined list of values.
Its based on pythons There's also a list of possible values returned by the function bellow as a list . There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. node's platform list is known even if gyp's is infinitely variable (at least the official ones, but if someone ports to a new platform and docs don't describe it at nodejs.org, that's not a problem). |
||||||||||||||
|
||||||||||||||
On Windows its value is always `"win32"`, on Mac OS X it's `"darwin"` and on | ||||||||||||||
Solaris it's `"sunos"`. | ||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These three values should be listed in the list below, not seperated out. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The windows exception shows that its always
|
||||||||||||||
|
||||||||||||||
Here's a list of possible values for some platforms: | ||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As I said, this feels to verbose. How about changing this whole part to:
Also, please linkify There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As its values is assigned on build and not during runtime. I believe its required to show the origin of it. Totally agree on linking, |
||||||||||||||
|
||||||||||||||
* Android: `"android"` | ||||||||||||||
* Windows/Cygwin: `"win32"` | ||||||||||||||
* Mac OS X: `"darwin"` | ||||||||||||||
* FreeBSD: `"freebsd"` | ||||||||||||||
* OpenBSD: `"openbsd"` | ||||||||||||||
* IBM AIX: `"aix"` | ||||||||||||||
* Solaris: `"sunos"` | ||||||||||||||
* Linux & Others: `"linux"` | ||||||||||||||
|
||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This entire list should be moved to the docs for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree that's a good idea. |
||||||||||||||
## os.arch() | ||||||||||||||
|
||||||||||||||
Returns the operating system CPU architecture. Possible values are `'x64'`, | ||||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this change, except
process.platform
should be a link.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure!