| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent ca23511 commit cc44325
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -352,10 +352,20 @@ function myWriter(output) { | |||
| 352 | 352 | added: v0.1.91 | |
| 353 | 353 | --> | |
| 354 | 354 | ||
| 355 | + * `options` {Object|string} See [`repl.start()`][] | ||
| 355 | 356 | * Extends: {readline.Interface} | |
| 356 | 357 | ||
| 357 | - Instances of `repl.REPLServer` are created using the `repl.start()` method and | ||
| 358 | - *should not* be created directly using the JavaScript `new` keyword. | ||
| 358 | + Instances of `repl.REPLServer` are created using the [`repl.start()`][] method | ||
| 359 | + or directly using the JavaScript `new` keyword. | ||
| 360 | + | ||
| 361 | + ```js | ||
| 362 | + const repl = require('repl'); | ||
| 363 | + | ||
| 364 | + const options = { useColors: true }; | ||
| 365 | + | ||
| 366 | + const firstInstance = repl.start(options); | ||
| 367 | + const secondInstance = new repl.REPLServer(options); | ||
| 368 | + ``` | ||
| 359 | 369 | ||
| 360 | 370 | ### Event: `'exit'` | |
| 361 | 371 | <!-- YAML | |
@@ -724,6 +734,7 @@ For an example of running a REPL instance over [curl(1)][], see: | |||
| 724 | 734 | [`process.setUncaughtExceptionCaptureCallback()`]: process.html#process_process_setuncaughtexceptioncapturecallback_fn | |
| 725 | 735 | [`readline.InterfaceCompleter`]: readline.html#readline_use_of_the_completer_function | |
| 726 | 736 | [`repl.ReplServer`]: #repl_class_replserver | |
| 737 | + [`repl.start()`]: #repl_repl_start_options | ||
| 727 | 738 | [`util.inspect()`]: util.html#util_util_inspect_object_options | |
| 728 | 739 | [curl(1)]: https://curl.haxx.se/docs/manpage.html | |
| 729 | 740 | [stream]: stream.html | |
| Back | FazBrowse Home | New Git URL |
0 commit comments