summaryrefslogtreecommitdiff
path: root/doc/api
diff options
context:
space:
mode:
authorMaledong <maledong_github@outlook.com>2019-09-01 11:07:24 +0800
committerRich Trott <rtrott@gmail.com>2019-09-03 14:21:34 -0700
commit3c84556654fb81d73a61b9d19bba3df6aac94e0e (patch)
tree5de605237404a21943a18c2bbb1726dd93a4ba4c /doc/api
parent40060f4e42a9f2c79d14c704f4496320b18c0483 (diff)
downloadandroid-node-v8-3c84556654fb81d73a61b9d19bba3df6aac94e0e.tar.gz
android-node-v8-3c84556654fb81d73a61b9d19bba3df6aac94e0e.tar.bz2
android-node-v8-3c84556654fb81d73a61b9d19bba3df6aac94e0e.zip
doc: change the 'txt' to 'console' for a command
This is the document formation, because `node` is a command to be executed, we should reguard it as a command prompt instead of a command txt type. PR-URL: https://github.com/nodejs/node/pull/29389 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Diffstat (limited to 'doc/api')
-rw-r--r--doc/api/buffer.md2
-rw-r--r--doc/api/cluster.md2
-rw-r--r--doc/api/debugger.md8
-rw-r--r--doc/api/fs.md2
-rw-r--r--doc/api/http.md4
-rw-r--r--doc/api/http2.md2
-rw-r--r--doc/api/modules.md2
-rw-r--r--doc/api/process.md4
-rw-r--r--doc/api/repl.md2
-rw-r--r--doc/api/stream.md2
10 files changed, 15 insertions, 15 deletions
diff --git a/doc/api/buffer.md b/doc/api/buffer.md
index ab7fcac31a..46bba08ef1 100644
--- a/doc/api/buffer.md
+++ b/doc/api/buffer.md
@@ -133,7 +133,7 @@ performance. Use of the `--zero-fill-buffers` option is recommended only when
necessary to enforce that newly allocated `Buffer` instances cannot contain old
data that is potentially sensitive.
-```txt
+```console
$ node --zero-fill-buffers
> Buffer.allocUnsafe(5);
<Buffer 00 00 00 00 00>
diff --git a/doc/api/cluster.md b/doc/api/cluster.md
index fb7328aa4d..979ddac5b9 100644
--- a/doc/api/cluster.md
+++ b/doc/api/cluster.md
@@ -41,7 +41,7 @@ if (cluster.isMaster) {
Running Node.js will now share port 8000 between the workers:
-```txt
+```console
$ node server.js
Master 3596 is running
Worker 4324 started
diff --git a/doc/api/debugger.md b/doc/api/debugger.md
index 5a5e1cd7c7..318b44de61 100644
--- a/doc/api/debugger.md
+++ b/doc/api/debugger.md
@@ -11,7 +11,7 @@ Node.js includes an out-of-process debugging utility accessible via a
with the `inspect` argument followed by the path to the script to debug; a
prompt will be displayed indicating successful launch of the debugger:
-```txt
+```console
$ node inspect myscript.js
< Debugger listening on ws://127.0.0.1:9229/80e7a814-7cd3-49fb-921a-2e02228cd5ba
< For help, see: https://nodejs.org/en/docs/inspector
@@ -42,7 +42,7 @@ console.log('hello');
Once the debugger is run, a breakpoint will occur at line 3:
-```txt
+```console
$ node inspect myscript.js
< Debugger listening on ws://127.0.0.1:9229/80e7a814-7cd3-49fb-921a-2e02228cd5ba
< For help, see: https://nodejs.org/en/docs/inspector
@@ -124,7 +124,7 @@ on line 1
It is also possible to set a breakpoint in a file (module) that
is not loaded yet:
-```txt
+```console
$ node inspect main.js
< Debugger listening on ws://127.0.0.1:9229/4e3db158-9791-4274-8909-914f7facf3bd
< For help, see: https://nodejs.org/en/docs/inspector
@@ -183,7 +183,7 @@ e.g. `--inspect=9222` will accept DevTools connections on port 9222.
To break on the first line of the application code, pass the `--inspect-brk`
flag instead of `--inspect`.
-```txt
+```console
$ node --inspect index.js
Debugger listening on 127.0.0.1:9229.
To start debugging, open the following URL in Chrome:
diff --git a/doc/api/fs.md b/doc/api/fs.md
index a045f45418..5341b4bc15 100644
--- a/doc/api/fs.md
+++ b/doc/api/fs.md
@@ -85,7 +85,7 @@ variable:
Omitting the callback function on asynchronous fs functions is deprecated and
may result in an error being thrown in the future.
-```txt
+```console
$ cat script.js
function bad() {
require('fs').readFile('/');
diff --git a/doc/api/http.md b/doc/api/http.md
index 639ac654b7..ed68a7be0d 100644
--- a/doc/api/http.md
+++ b/doc/api/http.md
@@ -1861,7 +1861,7 @@ Then `request.url` will be:
To parse the url into its parts `require('url').parse(request.url)`
can be used:
-```txt
+```console
$ node
> require('url').parse('/status?name=ryan')
Url {
@@ -1883,7 +1883,7 @@ To extract the parameters from the query string, the
`require('querystring').parse` function can be used, or
`true` can be passed as the second argument to `require('url').parse`:
-```txt
+```console
$ node
> require('url').parse('/status?name=ryan', true)
Url {
diff --git a/doc/api/http2.md b/doc/api/http2.md
index deceafd3ad..2046d903a4 100644
--- a/doc/api/http2.md
+++ b/doc/api/http2.md
@@ -2919,7 +2919,7 @@ To extract the parameters from the query string, the
`require('querystring').parse` function can be used, or
`true` can be passed as the second argument to `require('url').parse`.
-```txt
+```console
$ node
> require('url').parse('/status?name=ryan', true)
Url {
diff --git a/doc/api/modules.md b/doc/api/modules.md
index 7197ef6ae2..b6afe80a0d 100644
--- a/doc/api/modules.md
+++ b/doc/api/modules.md
@@ -330,7 +330,7 @@ provided to the `a.js` module.
By the time `main.js` has loaded both modules, they're both finished.
The output of this program would thus be:
-```txt
+```console
$ node main.js
main starting
a starting
diff --git a/doc/api/process.md b/doc/api/process.md
index 7c156e9492..a36cad6419 100644
--- a/doc/api/process.md
+++ b/doc/api/process.md
@@ -374,7 +374,7 @@ command-line option can be used to suppress the default console output but the
The following example illustrates the warning that is printed to `stderr` when
too many listeners have been added to an event:
-```txt
+```console
$ node
> events.defaultMaxListeners = 1;
> process.on('foo', () => {});
@@ -386,7 +386,7 @@ detected. 2 foo listeners added. Use emitter.setMaxListeners() to increase limit
In contrast, the following example turns off the default warning output and
adds a custom handler to the `'warning'` event:
-```txt
+```console
$ node --no-warnings
> const p = process.on('warning', (warning) => console.warn('Do not do that!'));
> events.defaultMaxListeners = 1;
diff --git a/doc/api/repl.md b/doc/api/repl.md
index 1edee77b09..b53c39dab2 100644
--- a/doc/api/repl.md
+++ b/doc/api/repl.md
@@ -439,7 +439,7 @@ replServer.defineCommand('saybye', function saybye() {
The new commands can then be used from within the REPL instance:
-```txt
+```console
> .sayhello Node.js User
Hello, Node.js User!
> .saybye
diff --git a/doc/api/stream.md b/doc/api/stream.md
index ccdb7e4180..6510dec541 100644
--- a/doc/api/stream.md
+++ b/doc/api/stream.md
@@ -900,7 +900,7 @@ rr.on('end', () => {
The output of running this script is:
-```txt
+```console
$ node test.js
readable: null
end