Skip to content

Commit

Permalink
doc: add return types and props types to OS module
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
imatveev authored and MylesBorins committed Dec 21, 2016
1 parent 241470c commit acebfed
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions doc/api/os.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ const os = require('os');
added: v0.7.8
-->

* {String}

A string constant defining the operating system-specific end-of-line marker:

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

## os.constants

* {Object}

Returns an object containing commonly used operating system specific constants
for error codes, process signals, and so on. The specific constants currently
defined are described in [OS Constants][].
Expand All @@ -44,6 +48,8 @@ defined are described in [OS Constants][].
added: v0.3.3
-->

* Returns: {Array}

The `os.cpus()` method returns an array of objects containing information about
each CPU/core installed.

Expand Down Expand Up @@ -161,6 +167,8 @@ all processors are always 0.
added: v0.9.4
-->

* Returns: {String}

The `os.endianness()` method returns a string identifying the endianness of the
CPU *for which the Node.js binary was compiled*.

Expand All @@ -174,6 +182,8 @@ Possible values are:
added: v0.3.3
-->

* Returns: {Integer}

The `os.freemem()` method returns the amount of free system memory in bytes as
an integer.

Expand All @@ -182,6 +192,8 @@ an integer.
added: v2.3.0
-->

* Returns: {String}

The `os.homedir()` method returns the home directory of the current user as a
string.

Expand All @@ -190,6 +202,8 @@ string.
added: v0.3.3
-->

* Returns: {String}

The `os.hostname()` method returns the hostname of the operating system as a
string.

Expand All @@ -198,6 +212,8 @@ string.
added: v0.3.3
-->

* Returns: {Array}

The `os.loadavg()` method returns an array containing the 1, 5, and 15 minute
load averages.

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

* Returns: {Object}

The `os.networkInterfaces()` method returns an object containing only network
interfaces that have been assigned a network address.

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

* Returns: {String}

The `os.platform()` method returns a string identifying the operating system
platform as set during compile time of Node.js.

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

* Returns: {String}

The `os.release()` method returns a string identifying the operating system
release.

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

* Returns: {String}

The `os.tmpdir()` method returns a string specifying the operating system's
default directory for temporary files.

Expand All @@ -316,6 +340,8 @@ default directory for temporary files.
added: v0.3.3
-->

* Returns: {Integer}

The `os.totalmem()` method returns the total amount of system memory in bytes
as an integer.

Expand All @@ -324,6 +350,8 @@ as an integer.
added: v0.3.3
-->

* Returns: {String}

The `os.type()` method returns a string identifying the operating system name
as returned by uname(3). For example `'Linux'` on Linux, `'Darwin'` on OS X and
`'Windows_NT'` on Windows.
Expand All @@ -336,6 +364,8 @@ information about the output of running uname(3) on various operating systems.
added: v0.3.3
-->

* Returns: {Integer}

The `os.uptime()` method returns the system uptime in number of seconds.

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

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

0 comments on commit acebfed

Please sign in to comment.