Skip to content

Commit f83d380

Browse files
benjamingrtellnes
authored andcommitted
doc: update os.markdown
Some doc update based on improvement ideas I remember from when I used this module in node: - Mention windows returns 0 for `nice` values (which is obvious, but io makes no attempt to calculate something similar or return undefined, 0 is returned) - Mention platform and arch are aliases for `process` properties. - Document possible return values where appropriate, add examples in others. - Rename title in order to match other titles in the navigation. - Fix line that was over 80 characters long. PR-URL: #976 Reviewed-By: Christian Tellnes <[email protected]> Reviewed-By: Brian White <[email protected]> Reviewed-By: Vladimir Kurchatkin <[email protected]>
1 parent 4d1fa2c commit f83d380

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

doc/api/os.markdown

+16-8
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# os
1+
# OS
22

33
Stability: 4 - API Frozen
44

@@ -8,28 +8,32 @@ Use `require('os')` to access this module.
88

99
## os.tmpdir()
1010

11-
Returns the operating system's default directory for temp files.
11+
Returns the operating system's default directory for temporary files.
1212

1313
## os.endianness()
1414

15-
Returns the endianness of the CPU. Possible values are `"BE"` or `"LE"`.
15+
Returns the endianness of the CPU. Possible values are `'BE'` for big endian
16+
or `'LE'` for little endian.
1617

1718
## os.hostname()
1819

1920
Returns the hostname of the operating system.
2021

2122
## os.type()
2223

23-
Returns the operating system name.
24+
Returns the operating system name. For example `'Linux'` on Linux, `'Darwin'`
25+
on OS X and `'Windows_NT'` on Windows.
2426

2527
## os.platform()
2628

27-
Returns the operating system platform.
29+
Returns the operating system platform. Possible values are `'darwin'`,
30+
`'freebsd'`, `'linux'`, `'sunos'` or `'win32'`. Returns the value of
31+
`process.platform`.
2832

2933
## os.arch()
3034

31-
Returns the operating system CPU architecture. Possible values are `"x64"`,
32-
`"arm"` and `"ia32"`.
35+
Returns the operating system CPU architecture. Possible values are `'x64'`,
36+
`'arm'` and `'ia32'`. Returns the value of `process.arch`.
3337

3438
## os.release()
3539

@@ -132,6 +136,9 @@ Example inspection of os.cpus:
132136
idle: 1072572010,
133137
irq: 30 } } ]
134138

139+
Note that since `nice` values are UNIX centric in Windows the `nice` values of
140+
all processors are always 0.
141+
135142
## os.networkInterfaces()
136143

137144
Get a list of network interfaces:
@@ -164,4 +171,5 @@ interfaces that have been assigned an address.
164171

165172
## os.EOL
166173

167-
A constant defining the appropriate End-of-line marker for the operating system.
174+
A constant defining the appropriate End-of-line marker for the operating
175+
system.

0 commit comments

Comments
 (0)