Skip to content

Commit

Permalink
doc: add process api data types to documentation
Browse files Browse the repository at this point in the history
PR-URL: #9505
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
  • Loading branch information
imatveev authored and MylesBorins committed Dec 21, 2016
1 parent 98b2eae commit d2a1a67
Showing 1 changed file with 56 additions and 2 deletions.
58 changes: 56 additions & 2 deletions doc/api/process.md
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,8 @@ generate a core file.
added: v0.5.0
-->

* {String}

The `process.arch` property returns a String identifying the processor
architecture that the Node.js process is currently running on. For instance
`'arm'`, `'ia32'`, or `'x64'`.
Expand All @@ -460,6 +462,8 @@ console.log(`This processor architecture is ${process.arch}`);
added: v0.1.27
-->

* {Array}

The `process.argv` property returns an array containing the command line
arguments passed when the Node.js process was launched. The first element will
be [`process.execPath`]. See `process.argv0` if access to the original value of
Expand Down Expand Up @@ -497,6 +501,8 @@ Would generate the output:
added: 6.4.0
-->

* {String}

The `process.argv0` property stores a read-only copy of the original value of
`argv[0]` passed when Node.js starts.

Expand Down Expand Up @@ -535,6 +541,8 @@ catch (err) {
added: v0.7.7
-->

* {Object}

The `process.config` property returns an Object containing the JavaScript
representation of the configure options used to compile the current Node.js
executable. This is the same as the `config.gypi` file that was produced when
Expand Down Expand Up @@ -578,6 +586,8 @@ replace the value of `process.config`.
added: v0.7.2
-->

* {Boolean}

If the Node.js process is spawned with an IPC channel (see the [Child Process][]
and [Cluster][] documentation), the `process.connected` property will return
`true` so long as the IPC channel is connected and will return `false` after
Expand All @@ -593,6 +603,9 @@ added: v6.1.0

* `previousValue` {Object} A previous return value from calling
`process.cpuUsage()`
* Return: {Object}
* `user` {Integer}
* `system` {Integer}

The `process.cpuUsage()` method returns the user and system CPU time usage of
the current process, in an object with properties `user` and `system`, whose
Expand Down Expand Up @@ -620,6 +633,8 @@ console.log(process.cpuUsage(startUsage));
added: v0.1.8
-->

* Return: {String}

The `process.cwd()` method returns the current working directory of the Node.js
process.

Expand Down Expand Up @@ -648,6 +663,8 @@ If the Node.js process was not spawned with an IPC channel,
added: v0.1.27
-->

* {Object}

The `process.env` property returns an object containing the user environment.
See environ(7).

Expand Down Expand Up @@ -812,6 +829,8 @@ emitMyWarning();
added: v0.7.7
-->

* {Object}

The `process.execArgv` property returns the set of Node.js-specific command-line
options passed when the Node.js process was launched. These options do not
appear in the array returned by the [`process.argv`][] property, and do not
Expand Down Expand Up @@ -842,13 +861,15 @@ And `process.argv`:
added: v0.1.100
-->

* {String}

The `process.execPath` property returns the absolute pathname of the executable
that started the Node.js process.

For example:

```sh
/usr/local/bin/node
```js
'/usr/local/bin/node'
```


Expand Down Expand Up @@ -921,6 +942,8 @@ is safer than calling `process.exit()`.
added: v0.11.8
-->

* {Integer}

A number which will be the process exit code, when the process either
exits gracefully, or is exited via [`process.exit()`][] without specifying
a code.
Expand Down Expand Up @@ -951,6 +974,8 @@ or Android)
added: v2.0.0
-->

* Return: {Object}

The `process.geteuid()` method returns the numerical effective user identity of
the process. (See geteuid(2).)

Expand All @@ -968,6 +993,8 @@ Android)
added: v0.1.31
-->

* Return: {Object}

The `process.getgid()` method returns the numerical group identity of the
process. (See getgid(2).)

Expand All @@ -986,6 +1013,8 @@ Android)
added: v0.9.4
-->

* Return: {Array}

The `process.getgroups()` method returns an array with the supplementary group
IDs. POSIX leaves it unspecified if the effective group ID is included but
Node.js ensures it always is.
Expand All @@ -998,6 +1027,8 @@ Android)
added: v0.1.28
-->

* Return: {Integer}

The `process.getuid()` method returns the numeric user identity of the process.
(See getuid(2).)

Expand Down Expand Up @@ -1130,6 +1161,11 @@ is no entry script.
added: v0.1.16
-->

* Return: {Object}
* `rss` {Integer}
* `heapTotal` {Integer}
* `heapUsed` {Integer}

The `process.memoryUsage()` method returns an object describing the memory usage
of the Node.js process measured in bytes.

Expand Down Expand Up @@ -1247,6 +1283,8 @@ happening, just like a `while(true);` loop.
added: v0.1.15
-->

* {Integer}

The `process.pid` property returns the PID of the process.

```js
Expand All @@ -1258,6 +1296,8 @@ console.log(`This process is pid ${process.pid}`);
added: v0.1.16
-->

* {String}

The `process.platform` property returns a string identifying the operating
system platform on which the Node.js process is running. For instance
`'darwin'`, `'freebsd'`, `'linux'`, `'sunos'` or `'win32'`
Expand Down Expand Up @@ -1465,6 +1505,8 @@ Android)

## process.stderr

* {Stream}

The `process.stderr` property returns a [Writable][] stream equivalent to or
associated with `stderr` (fd `2`).

Expand All @@ -1485,6 +1527,8 @@ on `process.stderr`, `process.stdout`, or `process.stdin`:

## process.stdin

* {Stream}

The `process.stdin` property returns a [Readable][] stream equivalent to or
associated with `stdin` (fd `0`).

Expand Down Expand Up @@ -1515,6 +1559,8 @@ must call `process.stdin.resume()` to read from it. Note also that calling

## process.stdout

* {Stream}

The `process.stdout` property returns a [Writable][] stream equivalent to or
associated with `stdout` (fd `1`).

Expand Down Expand Up @@ -1570,6 +1616,8 @@ See the [TTY][] documentation for more information.
added: v0.1.104
-->

* {String}

The `process.title` property returns the current process title (i.e. returns
the current value of `ps`). Assigning a new value to `process.title` modifies
the current value of `ps`.
Expand Down Expand Up @@ -1609,6 +1657,8 @@ console.log(
added: v0.5.0
-->

* Return: {Number}

The `process.uptime()` method returns the number of seconds the current Node.js
process has been running.

Expand All @@ -1617,6 +1667,8 @@ process has been running.
added: v0.1.3
-->

* {String}

The `process.version` property returns the Node.js version string.

```js
Expand All @@ -1628,6 +1680,8 @@ console.log(`Version: ${process.version}`);
added: v0.2.0
-->

* {Object}

The `process.versions` property returns an object listing the version strings of
Node.js and its dependencies.

Expand Down

0 comments on commit d2a1a67

Please sign in to comment.