| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 2501982 commit 2c85dd9
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -332,10 +332,20 @@ function myWriter(output) { | |||
| 332 | 332 | added: v0.1.91 | |
| 333 | 333 | --> | |
| 334 | 334 | ||
| 335 | + * `options` {Object|string} See [`repl.start()`][] | ||
| 335 | 336 | * Extends: {readline.Interface} | |
| 336 | 337 | ||
| 337 | - Instances of `repl.REPLServer` are created using the `repl.start()` method and | ||
| 338 | - *should not* be created directly using the JavaScript `new` keyword. | ||
| 338 | + Instances of `repl.REPLServer` are created using the [`repl.start()`][] method | ||
| 339 | + or directly using the JavaScript `new` keyword. | ||
| 340 | + | ||
| 341 | + ```js | ||
| 342 | + const repl = require('repl'); | ||
| 343 | + | ||
| 344 | + const options = { useColors: true }; | ||
| 345 | + | ||
| 346 | + const firstInstance = repl.start(options); | ||
| 347 | + const secondInstance = new repl.REPLServer(options); | ||
| 348 | + ``` | ||
| 339 | 349 | ||
| 340 | 350 | ### Event: `'exit'` | |
| 341 | 351 | <!-- YAML | |
@@ -697,6 +707,7 @@ For an example of running a REPL instance over [curl(1)][], see: | |||
| 697 | 707 | [`process.setUncaughtExceptionCaptureCallback()`]: process.html#process_process_setuncaughtexceptioncapturecallback_fn | |
| 698 | 708 | [`readline.InterfaceCompleter`]: readline.html#readline_use_of_the_completer_function | |
| 699 | 709 | [`repl.ReplServer`]: #repl_class_replserver | |
| 710 | + [`repl.start()`]: #repl_repl_start_options | ||
| 700 | 711 | [`util.inspect()`]: util.html#util_util_inspect_object_options | |
| 701 | 712 | [curl(1)]: https://curl.haxx.se/docs/manpage.html | |
| 702 | 713 | [stream]: stream.html | |
| Back | FazBrowse Home | New Git URL |
0 commit comments