diff options
author | Rich Trott <rtrott@gmail.com> | 2019-12-25 00:41:38 +0300 |
---|---|---|
committer | Ruben Bridgewater <ruben@bridgewater.de> | 2020-01-03 18:21:55 +0300 |
commit | 8c126527d92c10895baed8b33755db5d7d6fea80 (patch) | |
tree | 70d2c6848fedbae13e7082febaf0401ab694b428 | |
parent | 3ee3e6f5ff9c026344ff8f78e54c7a1f9b1f6e3f (diff) |
doc,process: use code markup/markdown in headers
PR-URL: https://github.com/nodejs/node/pull/31086
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
-rw-r--r-- | doc/api/process.md | 150 |
1 files changed, 75 insertions, 75 deletions
diff --git a/doc/api/process.md b/doc/api/process.md index 212c171cf88..c9f514d5d58 100644 --- a/doc/api/process.md +++ b/doc/api/process.md @@ -16,7 +16,7 @@ const process = require('process'); The `process` object is an instance of [`EventEmitter`][]. -### Event: 'beforeExit' +### Event: `'beforeExit'` <!-- YAML added: v0.11.12 --> @@ -53,7 +53,7 @@ console.log('This message is displayed first.'); // Process exit event with code: 0 ``` -### Event: 'disconnect' +### Event: `'disconnect'` <!-- YAML added: v0.7.7 --> @@ -62,7 +62,7 @@ If the Node.js process is spawned with an IPC channel (see the [Child Process][] and [Cluster][] documentation), the `'disconnect'` event will be emitted when the IPC channel is closed. -### Event: 'exit' +### Event: `'exit'` <!-- YAML added: v0.1.7 --> @@ -101,7 +101,7 @@ process.on('exit', (code) => { }); ``` -### Event: 'message' +### Event: `'message'` <!-- YAML added: v0.5.10 --> @@ -124,7 +124,7 @@ process, the `message` argument can contain data that JSON is not able to represent. See [Advanced Serialization for `child_process`][] for more details. -### Event: 'multipleResolves' +### Event: `'multipleResolves'` <!-- YAML added: v10.12.0 --> @@ -173,7 +173,7 @@ main().then(console.log); // First call ``` -### Event: 'rejectionHandled' +### Event: `'rejectionHandled'` <!-- YAML added: v1.4.1 --> @@ -220,7 +220,7 @@ possible to record such errors in an error log, either periodically (which is likely best for long-running application) or upon process exit (which is likely most convenient for scripts). -### Event: 'uncaughtException' +### Event: `'uncaughtException'` <!-- YAML added: v0.1.18 changes: @@ -289,7 +289,7 @@ To restart a crashed application in a more reliable way, whether in a separate process to detect application failures and recover or restart as needed. -### Event: 'unhandledRejection' +### Event: `'unhandledRejection'` <!-- YAML added: v1.4.1 changes: @@ -345,7 +345,7 @@ address such failures, a non-operational `resource.loaded`, which would prevent the `'unhandledRejection'` event from being emitted. -### Event: 'warning' +### Event: `'warning'` <!-- YAML added: v6.0.0 --> @@ -492,7 +492,7 @@ with [`process.kill()`][], and [`subprocess.kill()`][]. Sending signal `0` can be used to test for the existence of a process. Sending `SIGINT`, `SIGTERM`, and `SIGKILL` cause the unconditional termination of the target process. -## process.abort() +## `process.abort()` <!-- YAML added: v0.7.0 --> @@ -502,7 +502,7 @@ generate a core file. This feature is not available in [`Worker`][] threads. -## process.allowedNodeEnvironmentFlags +## `process.allowedNodeEnvironmentFlags` <!-- YAML added: v10.10.0 --> @@ -551,7 +551,7 @@ If Node.js was compiled *without* [`NODE_OPTIONS`][] support (shown in [`process.config`][]), `process.allowedNodeEnvironmentFlags` will contain what *would have* been allowable. -## process.arch +## `process.arch` <!-- YAML added: v0.5.0 --> @@ -566,7 +566,7 @@ Possible values are: `'arm'`, `'arm64'`, `'ia32'`, `'mips'`,`'mipsel'`, `'ppc'`, console.log(`This processor architecture is ${process.arch}`); ``` -## process.argv +## `process.argv` <!-- YAML added: v0.1.27 --> @@ -605,7 +605,7 @@ Would generate the output: 4: four ``` -## process.argv0 +## `process.argv0` <!-- YAML added: v6.4.0 --> @@ -623,7 +623,7 @@ $ bash -c 'exec -a customArgv0 ./node' 'customArgv0' ``` -## process.channel +## `process.channel` <!-- YAML added: v7.1.0 --> @@ -635,7 +635,7 @@ If the Node.js process was spawned with an IPC channel (see the property is a reference to the IPC channel. If no IPC channel exists, this property is `undefined`. -## process.chdir(directory) +## `process.chdir(directory)` <!-- YAML added: v0.1.17 --> @@ -658,7 +658,7 @@ try { This feature is not available in [`Worker`][] threads. -## process.config +## `process.config` <!-- YAML added: v0.7.7 --> @@ -705,7 +705,7 @@ The `process.config` property is **not** read-only and there are existing modules in the ecosystem that are known to extend, modify, or entirely replace the value of `process.config`. -## process.connected +## `process.connected` <!-- YAML added: v0.7.2 --> @@ -720,7 +720,7 @@ and [Cluster][] documentation), the `process.connected` property will return Once `process.connected` is `false`, it is no longer possible to send messages over the IPC channel using `process.send()`. -## process.cpuUsage(\[previousValue\]) +## `process.cpuUsage([previousValue])` <!-- YAML added: v6.1.0 --> @@ -752,7 +752,7 @@ console.log(process.cpuUsage(startUsage)); // { user: 514883, system: 11226 } ``` -## process.cwd() +## `process.cwd()` <!-- YAML added: v0.1.8 --> @@ -766,7 +766,7 @@ process. console.log(`Current directory: ${process.cwd()}`); ``` -## process.debugPort +## `process.debugPort` <!-- YAML added: v0.7.2 --> @@ -779,7 +779,7 @@ The port used by Node.js's debugger when enabled. process.debugPort = 5858; ``` -## process.disconnect() +## `process.disconnect()` <!-- YAML added: v0.7.2 --> @@ -795,7 +795,7 @@ The effect of calling `process.disconnect()` is the same as calling If the Node.js process was not spawned with an IPC channel, `process.disconnect()` will be `undefined`. -## process.dlopen(module, filename\[, flags\]) +## `process.dlopen(module, filename[, flags])` <!-- YAML added: v0.1.16 changes: @@ -837,7 +837,7 @@ process.dlopen(module, require.resolve('binding'), module.exports.foo(); ``` -## process.emitWarning(warning\[, options\]) +## `process.emitWarning(warning[, options])` <!-- YAML added: v8.0.0 --> @@ -883,7 +883,7 @@ process.on('warning', (warning) => { If `warning` is passed as an `Error` object, the `options` argument is ignored. -## process.emitWarning(warning\[, type\[, code\]\]\[, ctor\]) +## `process.emitWarning(warning[, type[, code]][, ctor])` <!-- YAML added: v6.0.0 --> @@ -980,7 +980,7 @@ emitMyWarning(); // Emits nothing ``` -## process.env +## `process.env` <!-- YAML added: v0.1.27 changes: @@ -1070,7 +1070,7 @@ to the [`Worker`][] constructor. Changes to `process.env` will not be visible across [`Worker`][] threads, and only the main thread can make changes that are visible to the operating system or to native add-ons. -## process.execArgv +## `process.execArgv` <!-- YAML added: v0.7.7 --> @@ -1102,7 +1102,7 @@ And `process.argv`: ['/usr/local/bin/node', 'script.js', '--version'] ``` -## process.execPath +## `process.execPath` <!-- YAML added: v0.1.100 --> @@ -1117,7 +1117,7 @@ that started the Node.js process. '/usr/local/bin/node' ``` -## process.exit(\[code\]) +## `process.exit([code])` <!-- YAML added: v0.1.13 --> @@ -1185,7 +1185,7 @@ is safer than calling `process.exit()`. In [`Worker`][] threads, this function stops the current thread rather than the current process. -## process.exitCode +## `process.exitCode` <!-- YAML added: v0.11.8 --> @@ -1199,7 +1199,7 @@ a code. Specifying a code to [`process.exit(code)`][`process.exit()`] will override any previous setting of `process.exitCode`. -## process.getegid() +## `process.getegid()` <!-- YAML added: v2.0.0 --> @@ -1216,7 +1216,7 @@ if (process.getegid) { This function is only available on POSIX platforms (i.e. not Windows or Android). -## process.geteuid() +## `process.geteuid()` <!-- YAML added: v2.0.0 --> @@ -1235,7 +1235,7 @@ if (process.geteuid) { This function is only available on POSIX platforms (i.e. not Windows or Android). -## process.getgid() +## `process.getgid()` <!-- YAML added: v0.1.31 --> @@ -1254,7 +1254,7 @@ if (process.getgid) { This function is only available on POSIX platforms (i.e. not Windows or Android). -## process.getgroups() +## `process.getgroups()` <!-- YAML added: v0.9.4 --> @@ -1268,7 +1268,7 @@ Node.js ensures it always is. This function is only available on POSIX platforms (i.e. not Windows or Android). -## process.getuid() +## `process.getuid()` <!-- YAML added: v0.1.28 --> @@ -1287,7 +1287,7 @@ if (process.getuid) { This function is only available on POSIX platforms (i.e. not Windows or Android). -## process.hasUncaughtExceptionCaptureCallback() +## `process.hasUncaughtExceptionCaptureCallback()` <!-- YAML added: v9.3.0 --> @@ -1297,7 +1297,7 @@ added: v9.3.0 Indicates whether a callback has been set using [`process.setUncaughtExceptionCaptureCallback()`][]. -## process.hrtime(\[time\]) +## `process.hrtime([time])` <!-- YAML added: v0.7.6 --> @@ -1336,7 +1336,7 @@ setTimeout(() => { }, 1000); ``` -## process.hrtime.bigint() +## `process.hrtime.bigint()` <!-- YAML added: v10.7.0 --> @@ -1363,7 +1363,7 @@ setTimeout(() => { }, 1000); ``` -## process.initgroups(user, extraGroup) +## `process.initgroups(user, extraGroup)` <!-- YAML added: v0.9.4 --> @@ -1390,7 +1390,7 @@ This function is only available on POSIX platforms (i.e. not Windows or Android). This feature is not available in [`Worker`][] threads. -## process.kill(pid\[, signal\]) +## `process.kill(pid[, signal])` <!-- YAML added: v0.0.6 --> @@ -1430,7 +1430,7 @@ process.kill(process.pid, 'SIGHUP'); When `SIGUSR1` is received by a Node.js process, Node.js will start the debugger. See [Signal Events][]. -## process.mainModule +## `process.mainModule` <!-- YAML added: v0.1.17 --> @@ -1446,7 +1446,7 @@ safe to assume that the two refer to the same module. As with [`require.main`][], `process.mainModule` will be `undefined` if there is no entry script. -## process.memoryUsage() +## `process.memoryUsage()` <!-- YAML added: v0.1.16 changes: @@ -1495,7 +1495,7 @@ _code segment_. When using [`Worker`][] threads, `rss` will be a value that is valid for the entire process, while the other fields will only refer to the current thread. -## process.nextTick(callback\[, ...args\]) +## `process.nextTick(callback[, ...args])` <!-- YAML added: v0.1.26 changes: @@ -1586,7 +1586,7 @@ function definitelyAsync(arg, cb) { } ``` -## process.noDeprecation +## `process.noDeprecation` <!-- YAML added: v0.8.0 --> @@ -1599,7 +1599,7 @@ the [`'warning'` event][process_warning] and the [`emitWarning()` method][process_emit_warning] for more information about this flag's behavior. -## process.pid +## `process.pid` <!-- YAML added: v0.1.15 --> @@ -1612,7 +1612,7 @@ The `process.pid` property returns the PID of the process. console.log(`This process is pid ${process.pid}`); ``` -## process.platform +## `process.platform` <!-- YAML added: v0.1.16 --> @@ -1640,7 +1640,7 @@ The value `'android'` may also be returned if the Node.js is built on the Android operating system. However, Android support in Node.js [is experimental][Android building]. -## process.ppid +## `process.ppid` <!-- YAML added: - v9.2.0 @@ -1656,7 +1656,7 @@ The `process.ppid` property returns the PID of the current parent process. console.log(`The parent process is pid ${process.ppid}`); ``` -## process.release +## `process.release` <!-- YAML added: v3.0.0 changes: @@ -1707,7 +1707,7 @@ In custom builds from non-release versions of the source tree, only the `name` property may be present. The additional properties should not be relied upon to exist. -## process.report +## `process.report` <!-- YAML added: v11.8.0 --> @@ -1720,7 +1720,7 @@ added: v11.8.0 reports for the current process. Additional documentation is available in the [report documentation][]. -### process.report.directory +### `process.report.directory` <!-- YAML added: v11.12.0 --> @@ -1737,7 +1737,7 @@ Node.js process. console.log(`Report directory is ${process.report.directory}`); ``` -### process.report.filename +### `process.report.filename` <!-- YAML added: v11.12.0 --> @@ -1754,7 +1754,7 @@ value is the empty string. console.log(`Report filename is ${process.report.filename}`); ``` -### process.report.getReport(\[err\]) +### `process.report.getReport([err])` <!-- YAML added: v11.8.0 --> @@ -1779,7 +1779,7 @@ fs.writeFileSync(util.inspect(data), 'my-report.log', 'utf8'); Additional documentation is available in the [report documentation][]. -### process.report.reportOnFatalError +### `process.report.reportOnFatalError` <!-- YAML added: v11.12.0 --> @@ -1795,7 +1795,7 @@ memory errors or failed C++ assertions. console.log(`Report on fatal error: ${process.report.reportOnFatalError}`); ``` -### process.report.reportOnSignal +### `process.report.reportOnSignal` <!-- YAML added: v11.12.0 --> @@ -1811,7 +1811,7 @@ signal specified by `process.report.signal`. console.log(`Report on signal: ${process.report.reportOnSignal}`); ``` -### process.report.reportOnUncaughtException +### `process.report.reportOnUncaughtException` <!-- YAML added: v11.12.0 --> @@ -1826,7 +1826,7 @@ If `true`, a diagnostic report is generated on uncaught exception. console.log(`Report on exception: ${process.report.reportOnUncaughtException}`); ``` -### process.report.signal +### `process.report.signal` <!-- YAML added: v11.12.0 --> @@ -1842,7 +1842,7 @@ The signal used to trigger the creation of a diagnostic report. Defaults to console.log(`Report signal: ${process.report.signal}`); ``` -### process.report.writeReport(\[filename\]\[, err\]) +### `process.report.writeReport([filename][, err])` <!-- YAML added: v11.8.0 --> @@ -1867,7 +1867,7 @@ process.report.writeReport(); Additional documentation is available in the [report documentation][]. -## process.resourceUsage() +## `process.resourceUsage()` <!-- YAML added: v12.6.0 --> @@ -1940,7 +1940,7 @@ console.log(process.resourceUsage()); */ ``` -## process.send(message\[, sendHandle\[, options\]\]\[, callback\]) +## `process.send(message[, sendHandle[, options]][, callback])` <!-- YAML added: v0.5.9 --> @@ -1965,7 +1965,7 @@ If Node.js was not spawned with an IPC channel, `process.send` will be The message goes through serialization and parsing. The resulting message might not be the same as what is originally sent. -## process.setegid(id) +## `process.setegid(id)` <!-- YAML added: v2.0.0 --> @@ -1993,7 +1993,7 @@ This function is only available on POSIX platforms (i.e. not Windows or Android). This feature is not available in [`Worker`][] threads. -## process.seteuid(id) +## `process.seteuid(id)` <!-- YAML added: v2.0.0 --> @@ -2021,7 +2021,7 @@ This function is only available on POSIX platforms (i.e. not Windows or Android). This feature is not available in [`Worker`][] threads. -## process.setgid(id) +## `process.setgid(id)` <!-- YAML added: v0.1.31 --> @@ -2049,7 +2049,7 @@ This function is only available on POSIX platforms (i.e. not Windows or Android). This feature is not available in [`Worker`][] threads. -## process.setgroups(groups) +## `process.setgroups(groups)` <!-- YAML added: v0.9.4 --> @@ -2066,7 +2066,7 @@ This function is only available on POSIX platforms (i.e. not Windows or Android). This feature is not available in [`Worker`][] threads. -## process.setuid(id) +## `process.setuid(id)` <!-- YAML added: v0.1.28 --> @@ -2094,7 +2094,7 @@ This function is only available on POSIX platforms (i.e. not Windows or Android). This feature is not available in [`Worker`][] threads. -## process.setUncaughtExceptionCaptureCallback(fn) +## `process.setUncaughtExceptionCaptureCallback(fn)` <!-- YAML added: v9.3.0 --> @@ -2118,7 +2118,7 @@ throw an error. Using this function is mutually exclusive with using the deprecated [`domain`][] built-in module. -## process.stderr +## `process.stderr` * {Stream} @@ -2130,7 +2130,7 @@ a [Writable][] stream. `process.stderr` differs from other Node.js streams in important ways. See [note on process I/O][] for more information. -## process.stdin +## `process.stdin` * {Stream} @@ -2163,7 +2163,7 @@ In "old" streams mode the `stdin` stream is paused by default, so one must call `process.stdin.resume()` to read from it. Note also that calling `process.stdin.resume()` itself would switch stream to "old" mode. -## process.stdout +## `process.stdout` * {Stream} @@ -2229,7 +2229,7 @@ false See the [TTY][] documentation for more information. -## process.throwDeprecation +## `process.throwDeprecation` <!-- YAML added: v0.9.12 --> @@ -2259,7 +2259,7 @@ Thrown: [DeprecationWarning: test] { name: 'DeprecationWarning' } ``` -## process.title +## `process.title` <!-- YAML added: v0.1.104 --> @@ -2279,7 +2279,7 @@ allowed for longer process title strings by also overwriting the `environ` memory but that was potentially insecure and confusing in some (rather obscure) cases. -## process.traceDeprecation +## `process.traceDeprecation` <!-- YAML added: v0.8.0 --> @@ -2292,7 +2292,7 @@ documentation for the [`'warning'` event][process_warning] and the [`emitWarning()` method][process_emit_warning] for more information about this flag's behavior. -## process.umask(\[mask\]) +## `process.umask([mask])` <!-- YAML added: v0.1.19 --> @@ -2315,7 +2315,7 @@ console.log( [`Worker`][] threads are able to read the umask, however attempting to set the umask will result in a thrown exception. -## process.uptime() +## `process.uptime()` <!-- YAML added: v0.5.0 --> @@ -2328,7 +2328,7 @@ process has been running. The return value includes fractions of a second. Use `Math.floor()` to get whole seconds. -## process.version +## `process.version` <!-- YAML added: v0.1.3 --> @@ -2341,7 +2341,7 @@ The `process.version` property returns the Node.js version string. console.log(`Version: ${process.version}`); ``` -## process.versions +## `process.versions` <!-- YAML added: v0.2.0 changes: |