Skip to content
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: os properties functions return types #9648

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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