Skip to content

Commit ae61232

Browse files
vsemozhetbytevanlucas
authored andcommitted
doc: white space unification in repl.md
Add an infix space in an argument list. Change `>` into `> ` in code bits and output examples. Explicitly clarify that default REPL prompt contains a trailing space. PR-URL: #10244 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Sakthipriyan Vairamani <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 37cb971 commit ae61232

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

doc/api/repl.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -217,10 +217,10 @@ following example, for instance, simply converts any input text to upper case:
217217
```js
218218
const repl = require('repl');
219219

220-
const r = repl.start({prompt: '>', eval: myEval, writer: myWriter});
220+
const r = repl.start({prompt: '> ', eval: myEval, writer: myWriter});
221221

222222
function myEval(cmd, context, filename, callback) {
223-
callback(null,cmd);
223+
callback(null, cmd);
224224
}
225225

226226
function myWriter(output) {
@@ -275,7 +275,7 @@ function initializeContext(context) {
275275
context.m = 'test';
276276
}
277277

278-
const r = repl.start({prompt: '>'});
278+
const r = repl.start({prompt: '> '});
279279
initializeContext(r.context);
280280

281281
r.on('reset', initializeContext);
@@ -286,15 +286,15 @@ reset to its initial value using the `.clear` command:
286286

287287
```js
288288
$ ./node example.js
289-
>m
289+
> m
290290
'test'
291-
>m = 1
291+
> m = 1
292292
1
293-
>m
293+
> m
294294
1
295-
>.clear
295+
> .clear
296296
Clearing context...
297-
>m
297+
> m
298298
'test'
299299
>
300300
```
@@ -371,8 +371,9 @@ within the action function for commands registered using the
371371
added: v0.1.91
372372
-->
373373

374-
* `options` {Object}
375-
* `prompt` {String} The input prompt to display. Defaults to `> `.
374+
* `options` {Object | String}
375+
* `prompt` {String} The input prompt to display. Defaults to `> `
376+
(with a trailing space).
376377
* `input` {Readable} The Readable stream from which REPL input will be read.
377378
Defaults to `process.stdin`.
378379
* `output` {Writable} The Writable stream to which REPL output will be

0 commit comments

Comments
 (0)