From 84e3a86bd5e65bd0705266fa050a0dcf41620340 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Tue, 24 Dec 2019 13:41:38 -0800 Subject: [PATCH] doc,process: use code markup/markdown in headers Backport-PR-URL: https://github.com/nodejs/node/pull/31108 PR-URL: https://github.com/nodejs/node/pull/31086 Reviewed-By: Anna Henningsen Reviewed-By: Ruben Bridgewater --- doc/api/process.md | 150 ++++++++++++++++++++++----------------------- 1 file changed, 75 insertions(+), 75 deletions(-) diff --git a/doc/api/process.md b/doc/api/process.md index 1ff369163b9126..d5b7cc023e334b 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'` @@ -53,7 +53,7 @@ console.log('This message is displayed first.'); // Process exit event with code: 0 ``` -### Event: 'disconnect' +### Event: `'disconnect'` @@ -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'` @@ -101,7 +101,7 @@ process.on('exit', (code) => { }); ``` -### Event: 'message' +### Event: `'message'` @@ -119,7 +119,7 @@ the child process. The message goes through serialization and parsing. The resulting message might not be the same as what is originally sent. -### Event: 'multipleResolves' +### Event: `'multipleResolves'` @@ -168,7 +168,7 @@ main().then(console.log); // First call ``` -### Event: 'rejectionHandled' +### Event: `'rejectionHandled'` @@ -215,7 +215,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'` @@ -485,7 +485,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()` @@ -495,7 +495,7 @@ generate a core file. This feature is not available in [`Worker`][] threads. -## process.allowedNodeEnvironmentFlags +## `process.allowedNodeEnvironmentFlags` @@ -544,7 +544,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` @@ -559,7 +559,7 @@ Possible values are: `'arm'`, `'arm64'`, `'ia32'`, `'mips'`,`'mipsel'`, `'ppc'`, console.log(`This processor architecture is ${process.arch}`); ``` -## process.argv +## `process.argv` @@ -598,7 +598,7 @@ Would generate the output: 4: four ``` -## process.argv0 +## `process.argv0` @@ -616,7 +616,7 @@ $ bash -c 'exec -a customArgv0 ./node' 'customArgv0' ``` -## process.channel +## `process.channel` @@ -628,7 +628,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)` @@ -651,7 +651,7 @@ try { This feature is not available in [`Worker`][] threads. -## process.config +## `process.config` @@ -698,7 +698,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` @@ -713,7 +713,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])` @@ -745,7 +745,7 @@ console.log(process.cpuUsage(startUsage)); // { user: 514883, system: 11226 } ``` -## process.cwd() +## `process.cwd()` @@ -759,7 +759,7 @@ process. console.log(`Current directory: ${process.cwd()}`); ``` -## process.debugPort +## `process.debugPort` @@ -772,7 +772,7 @@ The port used by Node.js's debugger when enabled. process.debugPort = 5858; ``` -## process.disconnect() +## `process.disconnect()` @@ -788,7 +788,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])` @@ -876,7 +876,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])` @@ -973,7 +973,7 @@ emitMyWarning(); // Emits nothing ``` -## process.env +## `process.env` @@ -1095,7 +1095,7 @@ And `process.argv`: ['/usr/local/bin/node', 'script.js', '--version'] ``` -## process.execPath +## `process.execPath` @@ -1110,7 +1110,7 @@ that started the Node.js process. '/usr/local/bin/node' ``` -## process.exit(\[code\]) +## `process.exit([code])` @@ -1178,7 +1178,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` @@ -1192,7 +1192,7 @@ a code. Specifying a code to [`process.exit(code)`][`process.exit()`] will override any previous setting of `process.exitCode`. -## process.getegid() +## `process.getegid()` @@ -1209,7 +1209,7 @@ if (process.getegid) { This function is only available on POSIX platforms (i.e. not Windows or Android). -## process.geteuid() +## `process.geteuid()` @@ -1228,7 +1228,7 @@ if (process.geteuid) { This function is only available on POSIX platforms (i.e. not Windows or Android). -## process.getgid() +## `process.getgid()` @@ -1247,7 +1247,7 @@ if (process.getgid) { This function is only available on POSIX platforms (i.e. not Windows or Android). -## process.getgroups() +## `process.getgroups()` @@ -1261,7 +1261,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()` @@ -1280,7 +1280,7 @@ if (process.getuid) { This function is only available on POSIX platforms (i.e. not Windows or Android). -## process.hasUncaughtExceptionCaptureCallback() +## `process.hasUncaughtExceptionCaptureCallback()` @@ -1290,7 +1290,7 @@ added: v9.3.0 Indicates whether a callback has been set using [`process.setUncaughtExceptionCaptureCallback()`][]. -## process.hrtime(\[time\]) +## `process.hrtime([time])` @@ -1329,7 +1329,7 @@ setTimeout(() => { }, 1000); ``` -## process.hrtime.bigint() +## `process.hrtime.bigint()` @@ -1356,7 +1356,7 @@ setTimeout(() => { }, 1000); ``` -## process.initgroups(user, extraGroup) +## `process.initgroups(user, extraGroup)` @@ -1383,7 +1383,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])` @@ -1423,7 +1423,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` @@ -1439,7 +1439,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()` @@ -1592,7 +1592,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` @@ -1605,7 +1605,7 @@ The `process.pid` property returns the PID of the process. console.log(`This process is pid ${process.pid}`); ``` -## process.platform +## `process.platform` @@ -1633,7 +1633,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` @@ -1713,7 +1713,7 @@ added: v11.8.0 reports for the current process. Additional documentation is available in the [report documentation][]. -### process.report.directory +### `process.report.directory` @@ -1730,7 +1730,7 @@ Node.js process. console.log(`Report directory is ${process.report.directory}`); ``` -### process.report.filename +### `process.report.filename` @@ -1747,7 +1747,7 @@ value is the empty string. console.log(`Report filename is ${process.report.filename}`); ``` -### process.report.getReport(\[err\]) +### `process.report.getReport([err])` @@ -1772,7 +1772,7 @@ fs.writeFileSync(util.inspect(data), 'my-report.log', 'utf8'); Additional documentation is available in the [report documentation][]. -### process.report.reportOnFatalError +### `process.report.reportOnFatalError` @@ -1788,7 +1788,7 @@ memory errors or failed C++ assertions. console.log(`Report on fatal error: ${process.report.reportOnFatalError}`); ``` -### process.report.reportOnSignal +### `process.report.reportOnSignal` @@ -1804,7 +1804,7 @@ signal specified by `process.report.signal`. console.log(`Report on signal: ${process.report.reportOnSignal}`); ``` -### process.report.reportOnUncaughtException +### `process.report.reportOnUncaughtException` @@ -1819,7 +1819,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` @@ -1835,7 +1835,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])` @@ -1860,7 +1860,7 @@ process.report.writeReport(); Additional documentation is available in the [report documentation][]. -## process.resourceUsage() +## `process.resourceUsage()` @@ -1933,7 +1933,7 @@ console.log(process.resourceUsage()); */ ``` -## process.send(message\[, sendHandle\[, options\]\]\[, callback\]) +## `process.send(message[, sendHandle[, options]][, callback])` @@ -1958,7 +1958,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)` @@ -1986,7 +1986,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)` @@ -2014,7 +2014,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)` @@ -2042,7 +2042,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)` @@ -2059,7 +2059,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)` @@ -2087,7 +2087,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)` @@ -2111,7 +2111,7 @@ throw an error. Using this function is mutually exclusive with using the deprecated [`domain`][] built-in module. -## process.stderr +## `process.stderr` * {Stream} @@ -2123,7 +2123,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} @@ -2156,7 +2156,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} @@ -2222,7 +2222,7 @@ false See the [TTY][] documentation for more information. -## process.throwDeprecation +## `process.throwDeprecation` @@ -2252,7 +2252,7 @@ Thrown: [DeprecationWarning: test] { name: 'DeprecationWarning' } ``` -## process.title +## `process.title` @@ -2272,7 +2272,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` @@ -2285,7 +2285,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])` @@ -2308,7 +2308,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()` @@ -2321,7 +2321,7 @@ process has been running. The return value includes fractions of a second. Use `Math.floor()` to get whole seconds. -## process.version +## `process.version` @@ -2334,7 +2334,7 @@ The `process.version` property returns the Node.js version string. console.log(`Version: ${process.version}`); ``` -## process.versions +## `process.versions`