mirror of https://github.com/nodejs/node.git
doc: update ```txt ```fandamental and ```raw code blocks
These are changed to either ```text or ```console. PR-URL: https://github.com/nodejs/node/pull/33028 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
This commit is contained in:
parent
0ff3819481
commit
f08174c9fb
|
@ -285,7 +285,7 @@ console.error(err.message);
|
||||||
The `error.stack` property is a string describing the point in the code at which
|
The `error.stack` property is a string describing the point in the code at which
|
||||||
the `Error` was instantiated.
|
the `Error` was instantiated.
|
||||||
|
|
||||||
```txt
|
```console
|
||||||
Error: Things keep happening!
|
Error: Things keep happening!
|
||||||
at /home/gbusey/file.js:525:2
|
at /home/gbusey/file.js:525:2
|
||||||
at Frobnicator.refrobulate (/home/gbusey/business-logic.js:424:21)
|
at Frobnicator.refrobulate (/home/gbusey/business-logic.js:424:21)
|
||||||
|
|
|
@ -3564,7 +3564,7 @@ is recommended.
|
||||||
|
|
||||||
For example, given the following directory structure:
|
For example, given the following directory structure:
|
||||||
|
|
||||||
```fundamental
|
```text
|
||||||
- txtDir
|
- txtDir
|
||||||
-- file.txt
|
-- file.txt
|
||||||
- app.js
|
- app.js
|
||||||
|
|
|
@ -2063,7 +2063,7 @@ added: v0.1.90
|
||||||
Request URL string. This contains only the URL that is
|
Request URL string. This contains only the URL that is
|
||||||
present in the actual HTTP request. If the request is:
|
present in the actual HTTP request. If the request is:
|
||||||
|
|
||||||
```txt
|
```http
|
||||||
GET /status?name=ryan HTTP/1.1\r\n
|
GET /status?name=ryan HTTP/1.1\r\n
|
||||||
Accept: text/plain\r\n
|
Accept: text/plain\r\n
|
||||||
\r\n
|
\r\n
|
||||||
|
|
|
@ -3004,7 +3004,7 @@ added: v8.4.0
|
||||||
Request URL string. This contains only the URL that is
|
Request URL string. This contains only the URL that is
|
||||||
present in the actual HTTP request. If the request is:
|
present in the actual HTTP request. If the request is:
|
||||||
|
|
||||||
```txt
|
```http
|
||||||
GET /status?name=ryan HTTP/1.1\r\n
|
GET /status?name=ryan HTTP/1.1\r\n
|
||||||
Accept: text/plain\r\n
|
Accept: text/plain\r\n
|
||||||
\r\n
|
\r\n
|
||||||
|
@ -3020,7 +3020,7 @@ Then `request.url` will be:
|
||||||
To parse the url into its parts `require('url').parse(request.url)`
|
To parse the url into its parts `require('url').parse(request.url)`
|
||||||
can be used:
|
can be used:
|
||||||
|
|
||||||
```txt
|
```console
|
||||||
$ node
|
$ node
|
||||||
> require('url').parse('/status?name=ryan')
|
> require('url').parse('/status?name=ryan')
|
||||||
Url {
|
Url {
|
||||||
|
|
|
@ -149,7 +149,7 @@ the `require.resolve()` function.
|
||||||
Putting together all of the above, here is the high-level algorithm
|
Putting together all of the above, here is the high-level algorithm
|
||||||
in pseudocode of what `require()` does:
|
in pseudocode of what `require()` does:
|
||||||
|
|
||||||
```txt
|
```text
|
||||||
require(X) from module at path Y
|
require(X) from module at path Y
|
||||||
1. If X is a core module,
|
1. If X is a core module,
|
||||||
a. return the core module
|
a. return the core module
|
||||||
|
@ -409,7 +409,7 @@ example, then `require('./some-library')` would attempt to load:
|
||||||
If these attempts fail, then Node.js will report the entire module as missing
|
If these attempts fail, then Node.js will report the entire module as missing
|
||||||
with the default error:
|
with the default error:
|
||||||
|
|
||||||
```txt
|
```console
|
||||||
Error: Cannot find module 'some-library'
|
Error: Cannot find module 'some-library'
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -503,7 +503,7 @@ containing `libuv` handle information and an OS platform information section
|
||||||
showing CPU and memory usage and system limits. An example report can be
|
showing CPU and memory usage and system limits. An example report can be
|
||||||
triggered using the Node.js REPL:
|
triggered using the Node.js REPL:
|
||||||
|
|
||||||
```raw
|
```console
|
||||||
$ node
|
$ node
|
||||||
> process.report.writeReport();
|
> process.report.writeReport();
|
||||||
Writing Node.js report to file: report.20181126.091102.8480.0.001.json
|
Writing Node.js report to file: report.20181126.091102.8480.0.001.json
|
||||||
|
|
|
@ -272,7 +272,7 @@ Reused, TLSv1.2, Cipher is ECDHE-RSA-AES128-GCM-SHA256
|
||||||
Node.js is built with a default suite of enabled and disabled TLS ciphers.
|
Node.js is built with a default suite of enabled and disabled TLS ciphers.
|
||||||
Currently, the default cipher suite is:
|
Currently, the default cipher suite is:
|
||||||
|
|
||||||
```txt
|
```text
|
||||||
TLS_AES_256_GCM_SHA384:
|
TLS_AES_256_GCM_SHA384:
|
||||||
TLS_CHACHA20_POLY1305_SHA256:
|
TLS_CHACHA20_POLY1305_SHA256:
|
||||||
TLS_AES_128_GCM_SHA256:
|
TLS_AES_128_GCM_SHA256:
|
||||||
|
|
|
@ -36,7 +36,7 @@ The available categories are:
|
||||||
|
|
||||||
By default the `node`, `node.async_hooks`, and `v8` categories are enabled.
|
By default the `node`, `node.async_hooks`, and `v8` categories are enabled.
|
||||||
|
|
||||||
```txt
|
```bash
|
||||||
node --trace-event-categories v8,node,node.async_hooks server.js
|
node --trace-event-categories v8,node,node.async_hooks server.js
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -45,10 +45,10 @@ flag to enable trace events. This requirement has been removed. However, the
|
||||||
`--trace-events-enabled` flag *may* still be used and will enable the
|
`--trace-events-enabled` flag *may* still be used and will enable the
|
||||||
`node`, `node.async_hooks`, and `v8` trace event categories by default.
|
`node`, `node.async_hooks`, and `v8` trace event categories by default.
|
||||||
|
|
||||||
```txt
|
```bash
|
||||||
node --trace-events-enabled
|
node --trace-events-enabled
|
||||||
|
|
||||||
// is equivalent to
|
# is equivalent to
|
||||||
|
|
||||||
node --trace-event-categories v8,node,node.async_hooks
|
node --trace-event-categories v8,node,node.async_hooks
|
||||||
```
|
```
|
||||||
|
@ -74,7 +74,7 @@ The logging file is by default called `node_trace.${rotation}.log`, where
|
||||||
be specified with `--trace-event-file-pattern` that accepts a template
|
be specified with `--trace-event-file-pattern` that accepts a template
|
||||||
string that supports `${rotation}` and `${pid}`:
|
string that supports `${rotation}` and `${pid}`:
|
||||||
|
|
||||||
```txt
|
```bash
|
||||||
node --trace-event-categories v8 --trace-event-file-pattern '${pid}-${rotation}.log' server.js
|
node --trace-event-categories v8 --trace-event-file-pattern '${pid}-${rotation}.log' server.js
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@ properties of a WHATWG `URL` object.
|
||||||
WHATWG URL's `origin` property includes `protocol` and `host`, but not
|
WHATWG URL's `origin` property includes `protocol` and `host`, but not
|
||||||
`username` or `password`.
|
`username` or `password`.
|
||||||
|
|
||||||
```txt
|
```text
|
||||||
┌────────────────────────────────────────────────────────────────────────────────────────────────┐
|
┌────────────────────────────────────────────────────────────────────────────────────────────────┐
|
||||||
│ href │
|
│ href │
|
||||||
├──────────┬──┬─────────────────────┬────────────────────────┬───────────────────────────┬───────┤
|
├──────────┬──┬─────────────────────┬────────────────────────┬───────────────────────────┬───────┤
|
||||||
|
@ -1288,7 +1288,7 @@ located within the structure of the URL.
|
||||||
Within the Legacy API, spaces (`' '`) and the following characters will be
|
Within the Legacy API, spaces (`' '`) and the following characters will be
|
||||||
automatically escaped in the properties of URL objects:
|
automatically escaped in the properties of URL objects:
|
||||||
|
|
||||||
```txt
|
```text
|
||||||
< > " ` \r \n \t { } | \ ^ '
|
< > " ` \r \n \t { } | \ ^ '
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,7 @@ callbackFunction((err, ret) => {
|
||||||
|
|
||||||
Will print:
|
Will print:
|
||||||
|
|
||||||
```txt
|
```text
|
||||||
hello world
|
hello world
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -93,7 +93,7 @@ debuglog('hello from foo [%d]', 123);
|
||||||
If this program is run with `NODE_DEBUG=foo` in the environment, then
|
If this program is run with `NODE_DEBUG=foo` in the environment, then
|
||||||
it will output something like:
|
it will output something like:
|
||||||
|
|
||||||
```txt
|
```console
|
||||||
FOO 3245: hello from foo [123]
|
FOO 3245: hello from foo [123]
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -112,7 +112,7 @@ debuglog('hi there, it\'s foo-bar [%d]', 2333);
|
||||||
if it is run with `NODE_DEBUG=foo*` in the environment, then it will output
|
if it is run with `NODE_DEBUG=foo*` in the environment, then it will output
|
||||||
something like:
|
something like:
|
||||||
|
|
||||||
```txt
|
```console
|
||||||
FOO-BAR 3257: hi there, it's foo-bar [2333]
|
FOO-BAR 3257: hi there, it's foo-bar [2333]
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@ the project's root.
|
||||||
When running `make`, you will see output similar to the following
|
When running `make`, you will see output similar to the following
|
||||||
if the build has succeeded:
|
if the build has succeeded:
|
||||||
|
|
||||||
```txt
|
```console
|
||||||
ninja: Entering directory `out/Release`
|
ninja: Entering directory `out/Release`
|
||||||
[4/4] LINK node, POSTBUILDS
|
[4/4] LINK node, POSTBUILDS
|
||||||
```
|
```
|
||||||
|
|
|
@ -178,7 +178,7 @@ situation would trigger the breaking change and what is the exact change.
|
||||||
|
|
||||||
Sample complete commit message:
|
Sample complete commit message:
|
||||||
|
|
||||||
```txt
|
```text
|
||||||
subsystem: explain the commit in one line
|
subsystem: explain the commit in one line
|
||||||
|
|
||||||
The body of the commit message should be one or more paragraphs, explaining
|
The body of the commit message should be one or more paragraphs, explaining
|
||||||
|
|
|
@ -344,7 +344,7 @@ The `CHANGELOG.md`, `doc/changelogs/CHANGELOG_Vx.md`, `src/node_version.h`, and
|
||||||
`REPLACEME` changes should be the final commit that will be tagged for the
|
`REPLACEME` changes should be the final commit that will be tagged for the
|
||||||
release. When committing these to git, use the following message format:
|
release. When committing these to git, use the following message format:
|
||||||
|
|
||||||
```txt
|
```text
|
||||||
YYYY-MM-DD, Version x.y.z (Release Type)
|
YYYY-MM-DD, Version x.y.z (Release Type)
|
||||||
|
|
||||||
Notable changes:
|
Notable changes:
|
||||||
|
@ -357,7 +357,7 @@ For security releases, begin the commit message with the phrase
|
||||||
[distribution indexer](https://github.com/nodejs/nodejs-dist-indexer) to
|
[distribution indexer](https://github.com/nodejs/nodejs-dist-indexer) to
|
||||||
identify it as such:
|
identify it as such:
|
||||||
|
|
||||||
```txt
|
```text
|
||||||
YYYY-MM-DD, Version x.y.z (Release Type)
|
YYYY-MM-DD, Version x.y.z (Release Type)
|
||||||
|
|
||||||
This is a security release.
|
This is a security release.
|
||||||
|
@ -493,7 +493,7 @@ $ git secure-tag <vx.y.z> <commit-sha> -sm "YYYY-MM-DD Node.js vx.y.z (<release-
|
||||||
`release-type` is either "Current" or "LTS". For LTS releases, you should also
|
`release-type` is either "Current" or "LTS". For LTS releases, you should also
|
||||||
include the release codename, for example:
|
include the release codename, for example:
|
||||||
|
|
||||||
```txt
|
```text
|
||||||
2019-10-22 Node.js v10.17.0 'Dubnium' (LTS) Release
|
2019-10-22 Node.js v10.17.0 'Dubnium' (LTS) Release
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -509,7 +509,7 @@ On release proposal branch, edit `src/node_version.h` again and:
|
||||||
|
|
||||||
Commit this change with the following commit message format:
|
Commit this change with the following commit message format:
|
||||||
|
|
||||||
```txt
|
```text
|
||||||
Working on vx.y.z # where 'z' is the incremented patch number
|
Working on vx.y.z # where 'z' is the incremented patch number
|
||||||
|
|
||||||
PR-URL: <full URL to your release proposal PR>
|
PR-URL: <full URL to your release proposal PR>
|
||||||
|
|
Loading…
Reference in New Issue