diff options
author | Vse Mozhet Byt <vsemozhetbyt@gmail.com> | 2016-12-13 01:34:49 +0200 |
---|---|---|
committer | Anna Henningsen <anna@addaleax.net> | 2016-12-25 19:50:22 +0100 |
commit | cb507af454196b9f28169ebd69cac9bf907cf274 (patch) | |
tree | 349dccc47c52de2c87d9c5e338cff547beb402c2 /doc/api/repl.md | |
parent | c919dd778874490ca9e50253d6e3de4d39200d98 (diff) | |
download | node-new-cb507af454196b9f28169ebd69cac9bf907cf274.tar.gz |
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: https://github.com/nodejs/node/pull/10244
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'doc/api/repl.md')
-rw-r--r-- | doc/api/repl.md | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/doc/api/repl.md b/doc/api/repl.md index ce8ddacc39..55549b2594 100644 --- a/doc/api/repl.md +++ b/doc/api/repl.md @@ -217,10 +217,10 @@ following example, for instance, simply converts any input text to upper case: ```js const repl = require('repl'); -const r = repl.start({prompt: '>', eval: myEval, writer: myWriter}); +const r = repl.start({prompt: '> ', eval: myEval, writer: myWriter}); function myEval(cmd, context, filename, callback) { - callback(null,cmd); + callback(null, cmd); } function myWriter(output) { @@ -275,7 +275,7 @@ function initializeContext(context) { context.m = 'test'; } -const r = repl.start({prompt: '>'}); +const r = repl.start({prompt: '> '}); initializeContext(r.context); r.on('reset', initializeContext); @@ -286,15 +286,15 @@ reset to its initial value using the `.clear` command: ```js $ ./node example.js ->m +> m 'test' ->m = 1 +> m = 1 1 ->m +> m 1 ->.clear +> .clear Clearing context... ->m +> m 'test' > ``` @@ -372,7 +372,8 @@ added: v0.1.91 --> * `options` {Object | String} - * `prompt` {String} The input prompt to display. Defaults to `> `. + * `prompt` {String} The input prompt to display. Defaults to `> ` + (with a trailing space). * `input` {Readable} The Readable stream from which REPL input will be read. Defaults to `process.stdin`. * `output` {Writable} The Writable stream to which REPL output will be |