Skip to content

Commit

Permalink
doc: change the 'txt' to 'console' for a command
Browse files Browse the repository at this point in the history
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: #29389
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
  • Loading branch information
Maledong authored and targos committed Sep 20, 2019
1 parent a20a8f4 commit 8023e43
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion doc/api/buffer.md
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion doc/api/cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions doc/api/debugger.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion doc/api/fs.md
Original file line number Diff line number Diff line change
Expand Up @@ -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('/');
Expand Down
4 changes: 2 additions & 2 deletions doc/api/http.md
Original file line number Diff line number Diff line change
Expand Up @@ -1853,7 +1853,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 {
Expand All @@ -1875,7 +1875,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 {
Expand Down
2 changes: 1 addition & 1 deletion doc/api/http2.md
Original file line number Diff line number Diff line change
Expand Up @@ -2932,7 +2932,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 {
Expand Down
2 changes: 1 addition & 1 deletion doc/api/modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions doc/api/process.md
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {});
Expand All @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion doc/api/repl.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion doc/api/stream.md
Original file line number Diff line number Diff line change
Expand Up @@ -897,7 +897,7 @@ rr.on('end', () => {

The output of running this script is:

```txt
```console
$ node test.js
readable: null
end
Expand Down

0 comments on commit 8023e43

Please sign in to comment.