-
-
Notifications
You must be signed in to change notification settings - Fork 33.5k
doc: Update docs for os.platform() #2446
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
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. | ||||||||||||||
|
||||||||||||||
|
||||||||||||||
On Windows its value is always `"win32"`, on Mac OS X it's `"darwin"` and on | ||||||||||||||
Solaris it's `"sunos"`. | ||||||||||||||
|
os | gyp |
os.platform |
---|---|---|
Windows | win |
win32 |
Mac | mac |
darwin |
Solaris | solaris |
sunos |
Outdated
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.
As I said, this feels to verbose. How about changing this whole part to:
Returns the value of `process.platform`, Possible values are:
Also, please linkify process.platform
.
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.
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,
Outdated
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.
This entire list should be moved to the docs for process.platform
.
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 agree that's a good idea.
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!