Skip to content

Commit

Permalink
doc: document argument variant in the repl.md
Browse files Browse the repository at this point in the history
`options` in the `repl.start([options])` can be a string.

Ref: #10160

PR-URL: #10221
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
  • Loading branch information
vsemozhetbyt authored and lance committed Dec 12, 2016
1 parent 499fc7a commit 50cb3a3
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion doc/api/repl.md
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ within the action function for commands registered using the
added: v0.1.91
-->

* `options` {Object}
* `options` {Object | String}
* `prompt` {String} The input prompt to display. Defaults to `> `.
* `input` {Readable} The Readable stream from which REPL input will be read.
Defaults to `process.stdin`.
Expand Down Expand Up @@ -413,6 +413,15 @@ added: v0.1.91

The `repl.start()` method creates and starts a `repl.REPLServer` instance.

If `options` is a string, then it specifies the input prompt:

```js
const repl = require('repl');

// a Unix style prompt
repl.start('$ ');
```

## The Node.js REPL

Node.js itself uses the `repl` module to provide its own interactive interface
Expand Down

0 comments on commit 50cb3a3

Please sign in to comment.