Skip to content

Commit daca360

Browse files
vsemozhetbytMylesBorins
authored andcommitted
doc: document argument variant in the repl.md
`options` in the `repl.start([options])` can be a string. Ref: #10160 PR-URL: #10221 Reviewed-By: Benjamin Gruenbaum <[email protected]>
1 parent e6eb8da commit daca360

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

doc/api/repl.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ within the action function for commands registered using the
371371
added: v0.1.91
372372
-->
373373

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

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

416+
If `options` is a string, then it specifies the input prompt:
417+
418+
```js
419+
const repl = require('repl');
420+
421+
// a Unix style prompt
422+
repl.start('$ ');
423+
```
424+
416425
## The Node.js REPL
417426

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

0 commit comments

Comments
 (0)