Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
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.
  • Loading branch information
vsemozhetbyt committed Dec 12, 2016
commit 94ff2e1abdfac2e796d982cfd34dc9179e8be8fe
19 changes: 10 additions & 9 deletions doc/api/repl.md
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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);
Expand All @@ -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'
>
```
Expand Down Expand Up @@ -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
Expand Down