Skip to content

Commit 77aded3

Browse files
imatveevaddaleax
authored andcommitted
doc: add process api data types to documentation
PR-URL: #9505 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Brian White <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Roman Reiss <[email protected]>
1 parent 7488b00 commit 77aded3

File tree

1 file changed

+56
-2
lines changed

1 file changed

+56
-2
lines changed

doc/api/process.md

+56-2
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

@@ -545,6 +551,8 @@ catch (err) {
545551
added: v0.7.7
546552
-->
547553

554+
* {Object}
555+
548556
The `process.config` property returns an Object containing the JavaScript
549557
representation of the configure options used to compile the current Node.js
550558
executable. This is the same as the `config.gypi` file that was produced when
@@ -588,6 +596,8 @@ replace the value of `process.config`.
588596
added: v0.7.2
589597
-->
590598

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

604614
* `previousValue` {Object} A previous return value from calling
605615
`process.cpuUsage()`
616+
* Return: {Object}
617+
* `user` {Integer}
618+
* `system` {Integer}
606619

607620
The `process.cpuUsage()` method returns the user and system CPU time usage of
608621
the current process, in an object with properties `user` and `system`, whose
@@ -630,6 +643,8 @@ console.log(process.cpuUsage(startUsage));
630643
added: v0.1.8
631644
-->
632645

646+
* Return: {String}
647+
633648
The `process.cwd()` method returns the current working directory of the Node.js
634649
process.
635650

@@ -658,6 +673,8 @@ If the Node.js process was not spawned with an IPC channel,
658673
added: v0.1.27
659674
-->
660675

676+
* {Object}
677+
661678
The `process.env` property returns an object containing the user environment.
662679
See environ(7).
663680

@@ -822,6 +839,8 @@ emitMyWarning();
822839
added: v0.7.7
823840
-->
824841

842+
* {Object}
843+
825844
The `process.execArgv` property returns the set of Node.js-specific command-line
826845
options passed when the Node.js process was launched. These options do not
827846
appear in the array returned by the [`process.argv`][] property, and do not
@@ -852,13 +871,15 @@ And `process.argv`:
852871
added: v0.1.100
853872
-->
854873

874+
* {String}
875+
855876
The `process.execPath` property returns the absolute pathname of the executable
856877
that started the Node.js process.
857878

858879
For example:
859880

860-
```sh
861-
/usr/local/bin/node
881+
```js
882+
'/usr/local/bin/node'
862883
```
863884

864885

@@ -931,6 +952,8 @@ is safer than calling `process.exit()`.
931952
added: v0.11.8
932953
-->
933954

955+
* {Integer}
956+
934957
A number which will be the process exit code, when the process either
935958
exits gracefully, or is exited via [`process.exit()`][] without specifying
936959
a code.
@@ -961,6 +984,8 @@ or Android)
961984
added: v2.0.0
962985
-->
963986

987+
* Return: {Object}
988+
964989
The `process.geteuid()` method returns the numerical effective user identity of
965990
the process. (See geteuid(2).)
966991

@@ -978,6 +1003,8 @@ Android)
9781003
added: v0.1.31
9791004
-->
9801005

1006+
* Return: {Object}
1007+
9811008
The `process.getgid()` method returns the numerical group identity of the
9821009
process. (See getgid(2).)
9831010

@@ -996,6 +1023,8 @@ Android)
9961023
added: v0.9.4
9971024
-->
9981025

1026+
* Return: {Array}
1027+
9991028
The `process.getgroups()` method returns an array with the supplementary group
10001029
IDs. POSIX leaves it unspecified if the effective group ID is included but
10011030
Node.js ensures it always is.
@@ -1008,6 +1037,8 @@ Android)
10081037
added: v0.1.28
10091038
-->
10101039

1040+
* Return: {Integer}
1041+
10111042
The `process.getuid()` method returns the numeric user identity of the process.
10121043
(See getuid(2).)
10131044

@@ -1140,6 +1171,11 @@ is no entry script.
11401171
added: v0.1.16
11411172
-->
11421173

1174+
* Return: {Object}
1175+
* `rss` {Integer}
1176+
* `heapTotal` {Integer}
1177+
* `heapUsed` {Integer}
1178+
11431179
The `process.memoryUsage()` method returns an object describing the memory usage
11441180
of the Node.js process measured in bytes.
11451181

@@ -1259,6 +1295,8 @@ happening, just like a `while(true);` loop.
12591295
added: v0.1.15
12601296
-->
12611297

1298+
* {Integer}
1299+
12621300
The `process.pid` property returns the PID of the process.
12631301

12641302
```js
@@ -1270,6 +1308,8 @@ console.log(`This process is pid ${process.pid}`);
12701308
added: v0.1.16
12711309
-->
12721310

1311+
* {String}
1312+
12731313
The `process.platform` property returns a string identifying the operating
12741314
system platform on which the Node.js process is running. For instance
12751315
`'darwin'`, `'freebsd'`, `'linux'`, `'sunos'` or `'win32'`
@@ -1471,6 +1511,8 @@ Android)
14711511

14721512
## process.stderr
14731513

1514+
* {Stream}
1515+
14741516
The `process.stderr` property returns a [Writable][] stream equivalent to or
14751517
associated with `stderr` (fd `2`).
14761518

@@ -1491,6 +1533,8 @@ on `process.stderr`, `process.stdout`, or `process.stdin`:
14911533

14921534
## process.stdin
14931535

1536+
* {Stream}
1537+
14941538
The `process.stdin` property returns a [Readable][] stream equivalent to or
14951539
associated with `stdin` (fd `0`).
14961540

@@ -1521,6 +1565,8 @@ must call `process.stdin.resume()` to read from it. Note also that calling
15211565

15221566
## process.stdout
15231567

1568+
* {Stream}
1569+
15241570
The `process.stdout` property returns a [Writable][] stream equivalent to or
15251571
associated with `stdout` (fd `1`).
15261572

@@ -1576,6 +1622,8 @@ See the [TTY][] documentation for more information.
15761622
added: v0.1.104
15771623
-->
15781624

1625+
* {String}
1626+
15791627
The `process.title` property returns the current process title (i.e. returns
15801628
the current value of `ps`). Assigning a new value to `process.title` modifies
15811629
the current value of `ps`.
@@ -1615,6 +1663,8 @@ console.log(
16151663
added: v0.5.0
16161664
-->
16171665

1666+
* Return: {Number}
1667+
16181668
The `process.uptime()` method returns the number of seconds the current Node.js
16191669
process has been running.
16201670

@@ -1623,6 +1673,8 @@ process has been running.
16231673
added: v0.1.3
16241674
-->
16251675

1676+
* {String}
1677+
16261678
The `process.version` property returns the Node.js version string.
16271679

16281680
```js
@@ -1634,6 +1686,8 @@ console.log(`Version: ${process.version}`);
16341686
added: v0.2.0
16351687
-->
16361688

1689+
* {Object}
1690+
16371691
The `process.versions` property returns an object listing the version strings of
16381692
Node.js and its dependencies.
16391693

0 commit comments

Comments
 (0)