Skip to content

Commit 40e4f0d

Browse files
imatveevMylesBorins
authored andcommitted
doc: add return types and props types to OS module
PR-URL: #9648 Reviewed-By: Roman Reiss <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Prince John Wesley <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
1 parent 93342d9 commit 40e4f0d

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

doc/api/os.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ const os = require('os');
1414
added: v0.7.8
1515
-->
1616

17+
* {String}
18+
1719
A string constant defining the operating system-specific end-of-line marker:
1820

1921
* `\n` on POSIX
@@ -35,6 +37,8 @@ Equivalent to [`process.arch`][].
3537

3638
## os.constants
3739

40+
* {Object}
41+
3842
Returns an object containing commonly used operating system specific constants
3943
for error codes, process signals, and so on. The specific constants currently
4044
defined are described in [OS Constants][].
@@ -44,6 +48,8 @@ defined are described in [OS Constants][].
4448
added: v0.3.3
4549
-->
4650

51+
* Returns: {Array}
52+
4753
The `os.cpus()` method returns an array of objects containing information about
4854
each CPU/core installed.
4955

@@ -161,6 +167,8 @@ all processors are always 0.
161167
added: v0.9.4
162168
-->
163169

170+
* Returns: {String}
171+
164172
The `os.endianness()` method returns a string identifying the endianness of the
165173
CPU *for which the Node.js binary was compiled*.
166174

@@ -174,6 +182,8 @@ Possible values are:
174182
added: v0.3.3
175183
-->
176184

185+
* Returns: {Integer}
186+
177187
The `os.freemem()` method returns the amount of free system memory in bytes as
178188
an integer.
179189

@@ -182,6 +192,8 @@ an integer.
182192
added: v2.3.0
183193
-->
184194

195+
* Returns: {String}
196+
185197
The `os.homedir()` method returns the home directory of the current user as a
186198
string.
187199

@@ -190,6 +202,8 @@ string.
190202
added: v0.3.3
191203
-->
192204

205+
* Returns: {String}
206+
193207
The `os.hostname()` method returns the hostname of the operating system as a
194208
string.
195209

@@ -198,6 +212,8 @@ string.
198212
added: v0.3.3
199213
-->
200214

215+
* Returns: {Array}
216+
201217
The `os.loadavg()` method returns an array containing the 1, 5, and 15 minute
202218
load averages.
203219

@@ -213,6 +229,8 @@ Windows platforms. On Windows, the return value is always `[0, 0, 0]`.
213229
added: v0.6.0
214230
-->
215231

232+
* Returns: {Object}
233+
216234
The `os.networkInterfaces()` method returns an object containing only network
217235
interfaces that have been assigned a network address.
218236

@@ -272,6 +290,8 @@ The properties available on the assigned network address object include:
272290
added: v0.5.0
273291
-->
274292

293+
* Returns: {String}
294+
275295
The `os.platform()` method returns a string identifying the operating system
276296
platform as set during compile time of Node.js.
277297

@@ -296,6 +316,8 @@ to be experimental at this time.
296316
added: v0.3.3
297317
-->
298318

319+
* Returns: {String}
320+
299321
The `os.release()` method returns a string identifying the operating system
300322
release.
301323

@@ -308,6 +330,8 @@ https://en.wikipedia.org/wiki/Uname#Examples for more information.
308330
added: v0.9.9
309331
-->
310332

333+
* Returns: {String}
334+
311335
The `os.tmpdir()` method returns a string specifying the operating system's
312336
default directory for temporary files.
313337

@@ -316,6 +340,8 @@ default directory for temporary files.
316340
added: v0.3.3
317341
-->
318342

343+
* Returns: {Integer}
344+
319345
The `os.totalmem()` method returns the total amount of system memory in bytes
320346
as an integer.
321347

@@ -324,6 +350,8 @@ as an integer.
324350
added: v0.3.3
325351
-->
326352

353+
* Returns: {String}
354+
327355
The `os.type()` method returns a string identifying the operating system name
328356
as returned by uname(3). For example `'Linux'` on Linux, `'Darwin'` on OS X and
329357
`'Windows_NT'` on Windows.
@@ -336,6 +364,8 @@ information about the output of running uname(3) on various operating systems.
336364
added: v0.3.3
337365
-->
338366

367+
* Returns: {Integer}
368+
339369
The `os.uptime()` method returns the system uptime in number of seconds.
340370

341371
*Note*: Within Node.js' internals, this number is represented as a `double`.
@@ -351,6 +381,7 @@ added: v6.0.0
351381
* `encoding` {String} Character encoding used to interpret resulting strings.
352382
If `encoding` is set to `'buffer'`, the `username`, `shell`, and `homedir`
353383
values will be `Buffer` instances. (Default: 'utf8')
384+
* Returns: {Object}
354385

355386
The `os.userInfo()` method returns information about the currently effective
356387
user -- on POSIX platforms, this is typically a subset of the password file. The

0 commit comments

Comments
 (0)