-
Notifications
You must be signed in to change notification settings - Fork 30.3k
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: add process api data types to documentation #9505
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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'`. | ||
|
@@ -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 | ||
|
@@ -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. | ||
|
||
|
@@ -545,6 +551,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 | ||
|
@@ -588,6 +596,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 | ||
|
@@ -603,6 +613,9 @@ added: v6.1.0 | |
|
||
* `previousValue` {Object} A previous return value from calling | ||
`process.cpuUsage()` | ||
* return: {Object} | ||
* `user` {Number} | ||
* `system` {Number} | ||
|
||
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 | ||
|
@@ -630,6 +643,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. | ||
|
||
|
@@ -658,6 +673,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). | ||
|
||
|
@@ -822,6 +839,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 | ||
|
@@ -852,13 +871,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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This shouldn't be |
||
/usr/local/bin/node | ||
'/usr/local/bin/node' | ||
``` | ||
|
||
|
||
|
@@ -931,6 +952,8 @@ is safer than calling `process.exit()`. | |
added: v0.11.8 | ||
--> | ||
|
||
* {Number} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You might be more specific here and use |
||
|
||
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. | ||
|
@@ -961,6 +984,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).) | ||
|
||
|
@@ -978,6 +1003,8 @@ Android) | |
added: v0.1.31 | ||
--> | ||
|
||
* return: {Object} | ||
|
||
The `process.getgid()` method returns the numerical group identity of the | ||
process. (See getgid(2).) | ||
|
||
|
@@ -996,6 +1023,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. | ||
|
@@ -1008,6 +1037,8 @@ Android) | |
added: v0.1.28 | ||
--> | ||
|
||
* return: {Number} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ditto about using There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same goes for any other non-floating point number values. |
||
|
||
The `process.getuid()` method returns the numeric user identity of the process. | ||
(See getuid(2).) | ||
|
||
|
@@ -1140,6 +1171,11 @@ is no entry script. | |
added: v0.1.16 | ||
--> | ||
|
||
* return: {Object} | ||
* `rss` {Number} | ||
* `heapTotal` {Number} | ||
* `heapUsed` {Number} | ||
|
||
The `process.memoryUsage()` method returns an object describing the memory usage | ||
of the Node.js process measured in bytes. | ||
|
||
|
@@ -1259,6 +1295,8 @@ happening, just like a `while(true);` loop. | |
added: v0.1.15 | ||
--> | ||
|
||
* {Number} | ||
|
||
The `process.pid` property returns the PID of the process. | ||
|
||
```js | ||
|
@@ -1270,6 +1308,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'` | ||
|
@@ -1471,6 +1511,8 @@ Android) | |
|
||
## process.stderr | ||
|
||
* {Stream} | ||
|
||
The `process.stderr` property returns a [Writable][] stream equivalent to or | ||
associated with `stderr` (fd `2`). | ||
|
||
|
@@ -1491,6 +1533,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`). | ||
|
||
|
@@ -1521,6 +1565,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`). | ||
|
||
|
@@ -1576,6 +1622,7 @@ See the [TTY][] documentation for more information. | |
added: v0.1.104 | ||
--> | ||
|
||
* {String} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For consistency with the other changes, maybe add a blank line after this line. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||
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`. | ||
|
@@ -1615,6 +1662,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. | ||
|
||
|
@@ -1623,6 +1672,8 @@ process has been running. | |
added: v0.1.3 | ||
--> | ||
|
||
* {String} | ||
|
||
The `process.version` property returns the Node.js version string. | ||
|
||
```js | ||
|
@@ -1634,6 +1685,8 @@ console.log(`Version: ${process.version}`); | |
added: v0.2.0 | ||
--> | ||
|
||
* return: {Object} | ||
|
||
The `process.versions` property returns an object listing the version strings of | ||
Node.js and its dependencies. | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you capitalize every instance of 'return' to look like 'Return'?