Browse Source

doc: document argument variant in the repl.md

`options` in the `repl.start([options])` can be a string.

Ref: https://github.com/nodejs/node/pull/10160

PR-URL: https://github.com/nodejs/node/pull/10221
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
v6.x
Vse Mozhet Byt 8 years ago
committed by Myles Borins
parent
commit
8c487de736
No known key found for this signature in database GPG Key ID: 933B01F40B5CA946
  1. 11
      doc/api/repl.md

11
doc/api/repl.md

@ -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`.
@ -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

Loading…
Cancel
Save