Skip to content

Commit

Permalink
doc: add added: information for os
Browse files Browse the repository at this point in the history
Via git spelunking, mostly.
Some functions have been renamed. Used the version in which they were
renamed.

Ref: #6578
PR-URL: #6609
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
  • Loading branch information
bengl authored and addaleax committed May 9, 2016
1 parent ec67abe commit 5a8c66a
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions doc/api/os.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,25 @@ Provides a few basic operating-system related utility functions.
Use `require('os')` to access this module.

## os.EOL
<!-- YAML
added: v0.7.8
-->

A constant defining the appropriate End-of-line marker for the operating
system.

## os.arch()
<!-- YAML
added: v0.5.0
-->

Returns the operating system CPU architecture. Possible values are `'x64'`,
`'arm'` and `'ia32'`. Returns the value of [`process.arch`][].

## os.cpus()
<!-- YAML
added: v0.3.3
-->

Returns an array of objects containing information about each CPU/core
installed: model, speed (in MHz), and times (an object containing the number of
Expand Down Expand Up @@ -95,23 +104,38 @@ Note that since `nice` values are UNIX centric in Windows the `nice` values of
all processors are always 0.

## os.endianness()
<!-- YAML
added: v0.9.4
-->

Returns the endianness of the CPU. Possible values are `'BE'` for big endian
or `'LE'` for little endian.

## os.freemem()
<!-- YAML
added: v0.3.3
-->

Returns the amount of free system memory in bytes.

## os.homedir()
<!-- YAML
added: v2.3.0
-->

Returns the home directory of the current user.

## os.hostname()
<!-- YAML
added: v0.3.3
-->

Returns the hostname of the operating system.

## os.loadavg()
<!-- YAML
added: v0.3.3
-->

Returns an array containing the 1, 5, and 15 minute load averages.

Expand All @@ -124,6 +148,9 @@ Windows platforms. That is why this function always returns `[0, 0, 0]` on
Windows.

## os.networkInterfaces()
<!-- YAML
added: v0.6.0
-->

Get a list of network interfaces:

Expand Down Expand Up @@ -156,33 +183,54 @@ Note that due to the underlying implementation this will only return network
interfaces that have been assigned an address.

## os.platform()
<!-- YAML
added: v0.5.0
-->

Returns the operating system platform. Possible values are `'darwin'`,
`'freebsd'`, `'linux'`, `'sunos'` or `'win32'`. Returns the value of
[`process.platform`][].

## os.release()
<!-- YAML
added: v0.3.3
-->

Returns the operating system release.

## os.tmpdir()
<!-- YAML
added: v0.9.9
-->

Returns the operating system's default directory for temporary files.

## os.totalmem()
<!-- YAML
added: v0.3.3
-->

Returns the total amount of system memory in bytes.

## os.type()
<!-- YAML
added: v0.3.3
-->

Returns the operating system name. For example `'Linux'` on Linux, `'Darwin'`
on OS X and `'Windows_NT'` on Windows.

## os.uptime()
<!-- YAML
added: v0.3.3
-->

Returns the system uptime in seconds.

## os.userInfo([options])
<!-- YAML
added: v6.0.0
-->

* `options` {Object}
* `encoding` {String} Character encoding used to interpret resulting strings.
Expand Down

0 comments on commit 5a8c66a

Please sign in to comment.