Skip to content

Commit d2a1a67

Browse files
imatveevMylesBorins
authored andcommitted
doc: add process api data types to documentation
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>
1 parent 98b2eae commit d2a1a67

File tree

1 file changed

+56
-2
lines changed

1 file changed

+56
-2
lines changed

doc/api/process.md

Lines changed: 56 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,8 @@ generate a core file.
447447
added: v0.5.0
448448
-->
449449

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

465+
* {Array}
466+
463467
The `process.argv` property returns an array containing the command line
464468
arguments passed when the Node.js process was launched. The first element will
465469
be [`process.execPath`]. See `process.argv0` if access to the original value of
@@ -497,6 +501,8 @@ Would generate the output:
497501
added: 6.4.0
498502
-->
499503

504+
* {String}
505+
500506
The `process.argv0` property stores a read-only copy of the original value of
501507
`argv[0]` passed when Node.js starts.
502508

@@ -535,6 +541,8 @@ catch (err) {
535541
added: v0.7.7
536542
-->
537543

544+
* {Object}
545+
538546
The `process.config` property returns an Object containing the JavaScript
539547
representation of the configure options used to compile the current Node.js
540548
executable. This is the same as the `config.gypi` file that was produced when
@@ -578,6 +586,8 @@ replace the value of `process.config`.
578586
added: v0.7.2
579587
-->
580588

589+
* {Boolean}
590+
581591
If the Node.js process is spawned with an IPC channel (see the [Child Process][]
582592
and [Cluster][] documentation), the `process.connected` property will return
583593
`true` so long as the IPC channel is connected and will return `false` after
@@ -593,6 +603,9 @@ added: v6.1.0
593603

594604
* `previousValue` {Object} A previous return value from calling
595605
`process.cpuUsage()`
606+
* Return: {Object}
607+
* `user` {Integer}
608+
* `system` {Integer}
596609

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

636+
* Return: {String}
637+
623638
The `process.cwd()` method returns the current working directory of the Node.js
624639
process.
625640

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

666+
* {Object}
667+
651668
The `process.env` property returns an object containing the user environment.
652669
See environ(7).
653670

@@ -812,6 +829,8 @@ emitMyWarning();
812829
added: v0.7.7
813830
-->
814831

832+
* {Object}
833+
815834
The `process.execArgv` property returns the set of Node.js-specific command-line
816835
options passed when the Node.js process was launched. These options do not
817836
appear in the array returned by the [`process.argv`][] property, and do not
@@ -842,13 +861,15 @@ And `process.argv`:
842861
added: v0.1.100
843862
-->
844863

864+
* {String}
865+
845866
The `process.execPath` property returns the absolute pathname of the executable
846867
that started the Node.js process.
847868

848869
For example:
849870

850-
```sh
851-
/usr/local/bin/node
871+
```js
872+
'/usr/local/bin/node'
852873
```
853874

854875

@@ -921,6 +942,8 @@ is safer than calling `process.exit()`.
921942
added: v0.11.8
922943
-->
923944

945+
* {Integer}
946+
924947
A number which will be the process exit code, when the process either
925948
exits gracefully, or is exited via [`process.exit()`][] without specifying
926949
a code.
@@ -951,6 +974,8 @@ or Android)
951974
added: v2.0.0
952975
-->
953976

977+
* Return: {Object}
978+
954979
The `process.geteuid()` method returns the numerical effective user identity of
955980
the process. (See geteuid(2).)
956981

@@ -968,6 +993,8 @@ Android)
968993
added: v0.1.31
969994
-->
970995

996+
* Return: {Object}
997+
971998
The `process.getgid()` method returns the numerical group identity of the
972999
process. (See getgid(2).)
9731000

@@ -986,6 +1013,8 @@ Android)
9861013
added: v0.9.4
9871014
-->
9881015

1016+
* Return: {Array}
1017+
9891018
The `process.getgroups()` method returns an array with the supplementary group
9901019
IDs. POSIX leaves it unspecified if the effective group ID is included but
9911020
Node.js ensures it always is.
@@ -998,6 +1027,8 @@ Android)
9981027
added: v0.1.28
9991028
-->
10001029

1030+
* Return: {Integer}
1031+
10011032
The `process.getuid()` method returns the numeric user identity of the process.
10021033
(See getuid(2).)
10031034

@@ -1130,6 +1161,11 @@ is no entry script.
11301161
added: v0.1.16
11311162
-->
11321163

1164+
* Return: {Object}
1165+
* `rss` {Integer}
1166+
* `heapTotal` {Integer}
1167+
* `heapUsed` {Integer}
1168+
11331169
The `process.memoryUsage()` method returns an object describing the memory usage
11341170
of the Node.js process measured in bytes.
11351171

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

1286+
* {Integer}
1287+
12501288
The `process.pid` property returns the PID of the process.
12511289

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

1299+
* {String}
1300+
12611301
The `process.platform` property returns a string identifying the operating
12621302
system platform on which the Node.js process is running. For instance
12631303
`'darwin'`, `'freebsd'`, `'linux'`, `'sunos'` or `'win32'`
@@ -1465,6 +1505,8 @@ Android)
14651505

14661506
## process.stderr
14671507

1508+
* {Stream}
1509+
14681510
The `process.stderr` property returns a [Writable][] stream equivalent to or
14691511
associated with `stderr` (fd `2`).
14701512

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

14861528
## process.stdin
14871529

1530+
* {Stream}
1531+
14881532
The `process.stdin` property returns a [Readable][] stream equivalent to or
14891533
associated with `stdin` (fd `0`).
14901534

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

15161560
## process.stdout
15171561

1562+
* {Stream}
1563+
15181564
The `process.stdout` property returns a [Writable][] stream equivalent to or
15191565
associated with `stdout` (fd `1`).
15201566

@@ -1570,6 +1616,8 @@ See the [TTY][] documentation for more information.
15701616
added: v0.1.104
15711617
-->
15721618

1619+
* {String}
1620+
15731621
The `process.title` property returns the current process title (i.e. returns
15741622
the current value of `ps`). Assigning a new value to `process.title` modifies
15751623
the current value of `ps`.
@@ -1609,6 +1657,8 @@ console.log(
16091657
added: v0.5.0
16101658
-->
16111659

1660+
* Return: {Number}
1661+
16121662
The `process.uptime()` method returns the number of seconds the current Node.js
16131663
process has been running.
16141664

@@ -1617,6 +1667,8 @@ process has been running.
16171667
added: v0.1.3
16181668
-->
16191669

1670+
* {String}
1671+
16201672
The `process.version` property returns the Node.js version string.
16211673

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

1683+
* {Object}
1684+
16311685
The `process.versions` property returns an object listing the version strings of
16321686
Node.js and its dependencies.
16331687

0 commit comments

Comments
 (0)