1# REPL 2 3<!--introduced_in=v0.10.0--> 4 5> Stability: 2 - Stable 6 7<!-- source_link=lib/repl.js --> 8 9The `repl` module provides a Read-Eval-Print-Loop (REPL) implementation that 10is available both as a standalone program or includible in other applications. 11It can be accessed using: 12 13```js 14const repl = require('repl'); 15``` 16 17## Design and features 18 19The `repl` module exports the [`repl.REPLServer`][] class. While running, 20instances of [`repl.REPLServer`][] will accept individual lines of user input, 21evaluate those according to a user-defined evaluation function, then output the 22result. Input and output may be from `stdin` and `stdout`, respectively, or may 23be connected to any Node.js [stream][]. 24 25Instances of [`repl.REPLServer`][] support automatic completion of inputs, 26completion preview, simplistic Emacs-style line editing, multi-line inputs, 27[ZSH][]-like reverse-i-search, [ZSH][]-like substring-based history search, 28ANSI-styled output, saving and restoring current REPL session state, error 29recovery, and customizable evaluation functions. Terminals that do not support 30ANSI styles and Emacs-style line editing automatically fall back to a limited 31feature set. 32 33### Commands and special keys 34 35The following special commands are supported by all REPL instances: 36 37* `.break`: When in the process of inputting a multi-line expression, enter 38 the `.break` command (or press <kbd>Ctrl</kbd>+<kbd>C</kbd>) to abort 39 further input or processing of that expression. 40* `.clear`: Resets the REPL `context` to an empty object and clears any 41 multi-line expression being input. 42* `.exit`: Close the I/O stream, causing the REPL to exit. 43* `.help`: Show this list of special commands. 44* `.save`: Save the current REPL session to a file: 45 `> .save ./file/to/save.js` 46* `.load`: Load a file into the current REPL session. 47 `> .load ./file/to/load.js` 48* `.editor`: Enter editor mode (<kbd>Ctrl</kbd>+<kbd>D</kbd> to finish, 49 <kbd>Ctrl</kbd>+<kbd>C</kbd> to cancel). 50 51```console 52> .editor 53// Entering editor mode (^D to finish, ^C to cancel) 54function welcome(name) { 55 return `Hello ${name}!`; 56} 57 58welcome('Node.js User'); 59 60// ^D 61'Hello Node.js User!' 62> 63``` 64 65The following key combinations in the REPL have these special effects: 66 67* <kbd>Ctrl</kbd>+<kbd>C</kbd>: When pressed once, has the same effect as the 68 `.break` command. 69 When pressed twice on a blank line, has the same effect as the `.exit` 70 command. 71* <kbd>Ctrl</kbd>+<kbd>D</kbd>: Has the same effect as the `.exit` command. 72* <kbd>Tab</kbd>: When pressed on a blank line, displays global and local (scope) 73 variables. When pressed while entering other input, displays relevant 74 autocompletion options. 75 76For key bindings related to the reverse-i-search, see [`reverse-i-search`][]. 77For all other key bindings, see [TTY keybindings][]. 78 79### Default evaluation 80 81By default, all instances of [`repl.REPLServer`][] use an evaluation function 82that evaluates JavaScript expressions and provides access to Node.js built-in 83modules. This default behavior can be overridden by passing in an alternative 84evaluation function when the [`repl.REPLServer`][] instance is created. 85 86#### JavaScript expressions 87 88The default evaluator supports direct evaluation of JavaScript expressions: 89 90```console 91> 1 + 1 922 93> const m = 2 94undefined 95> m + 1 963 97``` 98 99Unless otherwise scoped within blocks or functions, variables declared 100either implicitly or using the `const`, `let`, or `var` keywords 101are declared at the global scope. 102 103#### Global and local scope 104 105The default evaluator provides access to any variables that exist in the global 106scope. It is possible to expose a variable to the REPL explicitly by assigning 107it to the `context` object associated with each `REPLServer`: 108 109```js 110const repl = require('repl'); 111const msg = 'message'; 112 113repl.start('> ').context.m = msg; 114``` 115 116Properties in the `context` object appear as local within the REPL: 117 118```console 119$ node repl_test.js 120> m 121'message' 122``` 123 124Context properties are not read-only by default. To specify read-only globals, 125context properties must be defined using `Object.defineProperty()`: 126 127```js 128const repl = require('repl'); 129const msg = 'message'; 130 131const r = repl.start('> '); 132Object.defineProperty(r.context, 'm', { 133 configurable: false, 134 enumerable: true, 135 value: msg 136}); 137``` 138 139#### Accessing core Node.js modules 140 141The default evaluator will automatically load Node.js core modules into the 142REPL environment when used. For instance, unless otherwise declared as a 143global or scoped variable, the input `fs` will be evaluated on-demand as 144`global.fs = require('fs')`. 145 146```console 147> fs.createReadStream('./some/file'); 148``` 149 150#### Global uncaught exceptions 151<!-- YAML 152changes: 153 - version: v12.3.0 154 pr-url: https://github.com/nodejs/node/pull/27151 155 description: The `'uncaughtException'` event is from now on triggered if the 156 repl is used as standalone program. 157--> 158 159The REPL uses the [`domain`][] module to catch all uncaught exceptions for that 160REPL session. 161 162This use of the [`domain`][] module in the REPL has these side effects: 163 164* Uncaught exceptions only emit the [`'uncaughtException'`][] event in the 165 standalone REPL. Adding a listener for this event in a REPL within 166 another Node.js program results in [`ERR_INVALID_REPL_INPUT`][]. 167 168 ```js 169 const r = repl.start(); 170 171 r.write('process.on("uncaughtException", () => console.log("Foobar"));\n'); 172 // Output stream includes: 173 // TypeError [ERR_INVALID_REPL_INPUT]: Listeners for `uncaughtException` 174 // cannot be used in the REPL 175 176 r.close(); 177 ``` 178 179* Trying to use [`process.setUncaughtExceptionCaptureCallback()`][] throws 180 an [`ERR_DOMAIN_CANNOT_SET_UNCAUGHT_EXCEPTION_CAPTURE`][] error. 181 182#### Assignment of the `_` (underscore) variable 183<!-- YAML 184changes: 185 - version: v9.8.0 186 pr-url: https://github.com/nodejs/node/pull/18919 187 description: Added `_error` support. 188--> 189 190The default evaluator will, by default, assign the result of the most recently 191evaluated expression to the special variable `_` (underscore). 192Explicitly setting `_` to a value will disable this behavior. 193 194```console 195> [ 'a', 'b', 'c' ] 196[ 'a', 'b', 'c' ] 197> _.length 1983 199> _ += 1 200Expression assignment to _ now disabled. 2014 202> 1 + 1 2032 204> _ 2054 206``` 207 208Similarly, `_error` will refer to the last seen error, if there was any. 209Explicitly setting `_error` to a value will disable this behavior. 210 211```console 212> throw new Error('foo'); 213Error: foo 214> _error.message 215'foo' 216``` 217 218#### `await` keyword 219 220With the [`--experimental-repl-await`][] command-line option specified, 221experimental support for the `await` keyword is enabled. 222 223```console 224> await Promise.resolve(123) 225123 226> await Promise.reject(new Error('REPL await')) 227Error: REPL await 228 at repl:1:45 229> const timeout = util.promisify(setTimeout); 230undefined 231> const old = Date.now(); await timeout(1000); console.log(Date.now() - old); 2321002 233undefined 234``` 235 236One known limitation of using the `await` keyword in the REPL is that 237it will invalidate the lexical scoping of the `const` and `let` 238keywords. 239 240For example: 241 242```console 243> const m = await Promise.resolve(123) 244undefined 245> m 246123 247> const m = await Promise.resolve(234) 248undefined 249> m 250234 251``` 252 253### Reverse-i-search 254<!-- YAML 255added: v13.6.0 256--> 257 258The REPL supports bi-directional reverse-i-search similar to [ZSH][]. It is 259triggered with <kbd>Ctrl</kbd>+<kbd>R</kbd> to search backward and 260<kbd>Ctrl</kbd>+<kbd>S</kbd> to search 261forwards. 262 263Duplicated history entries will be skipped. 264 265Entries are accepted as soon as any key is pressed that doesn't correspond 266with the reverse search. Cancelling is possible by pressing <kbd>Esc</kbd> or 267<kbd>Ctrl</kbd>+<kbd>C</kbd>. 268 269Changing the direction immediately searches for the next entry in the expected 270direction from the current position on. 271 272### Custom evaluation functions 273 274When a new [`repl.REPLServer`][] is created, a custom evaluation function may be 275provided. This can be used, for instance, to implement fully customized REPL 276applications. 277 278The following illustrates a hypothetical example of a REPL that performs 279translation of text from one language to another: 280 281```js 282const repl = require('repl'); 283const { Translator } = require('translator'); 284 285const myTranslator = new Translator('en', 'fr'); 286 287function myEval(cmd, context, filename, callback) { 288 callback(null, myTranslator.translate(cmd)); 289} 290 291repl.start({ prompt: '> ', eval: myEval }); 292``` 293 294#### Recoverable errors 295 296At the REPL prompt, pressing <kbd>Enter</kbd> sends the current line of input to 297the `eval` function. In order to support multi-line input, the `eval` function 298can return an instance of `repl.Recoverable` to the provided callback function: 299 300```js 301function myEval(cmd, context, filename, callback) { 302 let result; 303 try { 304 result = vm.runInThisContext(cmd); 305 } catch (e) { 306 if (isRecoverableError(e)) { 307 return callback(new repl.Recoverable(e)); 308 } 309 } 310 callback(null, result); 311} 312 313function isRecoverableError(error) { 314 if (error.name === 'SyntaxError') { 315 return /^(Unexpected end of input|Unexpected token)/.test(error.message); 316 } 317 return false; 318} 319``` 320 321### Customizing REPL output 322 323By default, [`repl.REPLServer`][] instances format output using the 324[`util.inspect()`][] method before writing the output to the provided `Writable` 325stream (`process.stdout` by default). The `showProxy` inspection option is set 326to true by default and the `colors` option is set to true depending on the 327REPL's `useColors` option. 328 329The `useColors` boolean option can be specified at construction to instruct the 330default writer to use ANSI style codes to colorize the output from the 331`util.inspect()` method. 332 333If the REPL is run as standalone program, it is also possible to change the 334REPL's [inspection defaults][`util.inspect()`] from inside the REPL by using the 335`inspect.replDefaults` property which mirrors the `defaultOptions` from 336[`util.inspect()`][]. 337 338```console 339> util.inspect.replDefaults.compact = false; 340false 341> [1] 342[ 343 1 344] 345> 346``` 347 348To fully customize the output of a [`repl.REPLServer`][] instance pass in a new 349function for the `writer` option on construction. The following example, for 350instance, simply converts any input text to upper case: 351 352```js 353const repl = require('repl'); 354 355const r = repl.start({ prompt: '> ', eval: myEval, writer: myWriter }); 356 357function myEval(cmd, context, filename, callback) { 358 callback(null, cmd); 359} 360 361function myWriter(output) { 362 return output.toUpperCase(); 363} 364``` 365 366## Class: `REPLServer` 367<!-- YAML 368added: v0.1.91 369--> 370 371* `options` {Object|string} See [`repl.start()`][] 372* Extends: {readline.Interface} 373 374Instances of `repl.REPLServer` are created using the [`repl.start()`][] method 375or directly using the JavaScript `new` keyword. 376 377```js 378const repl = require('repl'); 379 380const options = { useColors: true }; 381 382const firstInstance = repl.start(options); 383const secondInstance = new repl.REPLServer(options); 384``` 385 386### Event: `'exit'` 387<!-- YAML 388added: v0.7.7 389--> 390 391The `'exit'` event is emitted when the REPL is exited either by receiving the 392`.exit` command as input, the user pressing <kbd>Ctrl</kbd>+<kbd>C</kbd> twice 393to signal `SIGINT`, 394or by pressing <kbd>Ctrl</kbd>+<kbd>D</kbd> to signal `'end'` on the input 395stream. The listener 396callback is invoked without any arguments. 397 398```js 399replServer.on('exit', () => { 400 console.log('Received "exit" event from repl!'); 401 process.exit(); 402}); 403``` 404 405### Event: `'reset'` 406<!-- YAML 407added: v0.11.0 408--> 409 410The `'reset'` event is emitted when the REPL's context is reset. This occurs 411whenever the `.clear` command is received as input *unless* the REPL is using 412the default evaluator and the `repl.REPLServer` instance was created with the 413`useGlobal` option set to `true`. The listener callback will be called with a 414reference to the `context` object as the only argument. 415 416This can be used primarily to re-initialize REPL context to some pre-defined 417state: 418 419```js 420const repl = require('repl'); 421 422function initializeContext(context) { 423 context.m = 'test'; 424} 425 426const r = repl.start({ prompt: '> ' }); 427initializeContext(r.context); 428 429r.on('reset', initializeContext); 430``` 431 432When this code is executed, the global `'m'` variable can be modified but then 433reset to its initial value using the `.clear` command: 434 435```console 436$ ./node example.js 437> m 438'test' 439> m = 1 4401 441> m 4421 443> .clear 444Clearing context... 445> m 446'test' 447> 448``` 449 450### `replServer.defineCommand(keyword, cmd)` 451<!-- YAML 452added: v0.3.0 453--> 454 455* `keyword` {string} The command keyword (*without* a leading `.` character). 456* `cmd` {Object|Function} The function to invoke when the command is processed. 457 458The `replServer.defineCommand()` method is used to add new `.`-prefixed commands 459to the REPL instance. Such commands are invoked by typing a `.` followed by the 460`keyword`. The `cmd` is either a `Function` or an `Object` with the following 461properties: 462 463* `help` {string} Help text to be displayed when `.help` is entered (Optional). 464* `action` {Function} The function to execute, optionally accepting a single 465 string argument. 466 467The following example shows two new commands added to the REPL instance: 468 469```js 470const repl = require('repl'); 471 472const replServer = repl.start({ prompt: '> ' }); 473replServer.defineCommand('sayhello', { 474 help: 'Say hello', 475 action(name) { 476 this.clearBufferedCommand(); 477 console.log(`Hello, ${name}!`); 478 this.displayPrompt(); 479 } 480}); 481replServer.defineCommand('saybye', function saybye() { 482 console.log('Goodbye!'); 483 this.close(); 484}); 485``` 486 487The new commands can then be used from within the REPL instance: 488 489```console 490> .sayhello Node.js User 491Hello, Node.js User! 492> .saybye 493Goodbye! 494``` 495 496### `replServer.displayPrompt([preserveCursor])` 497<!-- YAML 498added: v0.1.91 499--> 500 501* `preserveCursor` {boolean} 502 503The `replServer.displayPrompt()` method readies the REPL instance for input 504from the user, printing the configured `prompt` to a new line in the `output` 505and resuming the `input` to accept new input. 506 507When multi-line input is being entered, an ellipsis is printed rather than the 508'prompt'. 509 510When `preserveCursor` is `true`, the cursor placement will not be reset to `0`. 511 512The `replServer.displayPrompt` method is primarily intended to be called from 513within the action function for commands registered using the 514`replServer.defineCommand()` method. 515 516### `replServer.clearBufferedCommand()` 517<!-- YAML 518added: v9.0.0 519--> 520 521The `replServer.clearBufferedCommand()` method clears any command that has been 522buffered but not yet executed. This method is primarily intended to be 523called from within the action function for commands registered using the 524`replServer.defineCommand()` method. 525 526### `replServer.parseREPLKeyword(keyword[, rest])` 527<!-- YAML 528added: v0.8.9 529deprecated: v9.0.0 530--> 531 532> Stability: 0 - Deprecated. 533 534* `keyword` {string} the potential keyword to parse and execute 535* `rest` {any} any parameters to the keyword command 536* Returns: {boolean} 537 538An internal method used to parse and execute `REPLServer` keywords. 539Returns `true` if `keyword` is a valid keyword, otherwise `false`. 540 541### `replServer.setupHistory(historyPath, callback)` 542<!-- YAML 543added: v11.10.0 544--> 545 546* `historyPath` {string} the path to the history file 547* `callback` {Function} called when history writes are ready or upon error 548 * `err` {Error} 549 * `repl` {repl.REPLServer} 550 551Initializes a history log file for the REPL instance. When executing the 552Node.js binary and using the command-line REPL, a history file is initialized 553by default. However, this is not the case when creating a REPL 554programmatically. Use this method to initialize a history log file when working 555with REPL instances programmatically. 556 557## `repl.builtinModules` 558<!-- YAML 559added: v14.5.0 560--> 561 562* {string[]} 563 564A list of the names of all Node.js modules, e.g., `'http'`. 565 566## `repl.start([options])` 567<!-- YAML 568added: v0.1.91 569changes: 570 - version: v13.4.0 571 pr-url: https://github.com/nodejs/node/pull/30811 572 description: The `preview` option is now available. 573 - version: v12.0.0 574 pr-url: https://github.com/nodejs/node/pull/26518 575 description: The `terminal` option now follows the default description in 576 all cases and `useColors` checks `hasColors()` if available. 577 - version: v10.0.0 578 pr-url: https://github.com/nodejs/node/pull/19187 579 description: The `REPL_MAGIC_MODE` `replMode` was removed. 580 - version: v6.3.0 581 pr-url: https://github.com/nodejs/node/pull/6635 582 description: The `breakEvalOnSigint` option is supported now. 583 - version: v5.8.0 584 pr-url: https://github.com/nodejs/node/pull/5388 585 description: The `options` parameter is optional now. 586--> 587 588* `options` {Object|string} 589 * `prompt` {string} The input prompt to display. **Default:** `'> '` 590 (with a trailing space). 591 * `input` {stream.Readable} The `Readable` stream from which REPL input will 592 be read. **Default:** `process.stdin`. 593 * `output` {stream.Writable} The `Writable` stream to which REPL output will 594 be written. **Default:** `process.stdout`. 595 * `terminal` {boolean} If `true`, specifies that the `output` should be 596 treated as a TTY terminal. 597 **Default:** checking the value of the `isTTY` property on the `output` 598 stream upon instantiation. 599 * `eval` {Function} The function to be used when evaluating each given line 600 of input. **Default:** an async wrapper for the JavaScript `eval()` 601 function. An `eval` function can error with `repl.Recoverable` to indicate 602 the input was incomplete and prompt for additional lines. 603 * `useColors` {boolean} If `true`, specifies that the default `writer` 604 function should include ANSI color styling to REPL output. If a custom 605 `writer` function is provided then this has no effect. **Default:** checking 606 color support on the `output` stream if the REPL instance's `terminal` value 607 is `true`. 608 * `useGlobal` {boolean} If `true`, specifies that the default evaluation 609 function will use the JavaScript `global` as the context as opposed to 610 creating a new separate context for the REPL instance. The node CLI REPL 611 sets this value to `true`. **Default:** `false`. 612 * `ignoreUndefined` {boolean} If `true`, specifies that the default writer 613 will not output the return value of a command if it evaluates to 614 `undefined`. **Default:** `false`. 615 * `writer` {Function} The function to invoke to format the output of each 616 command before writing to `output`. **Default:** [`util.inspect()`][]. 617 * `completer` {Function} An optional function used for custom Tab auto 618 completion. See [`readline.InterfaceCompleter`][] for an example. 619 * `replMode` {symbol} A flag that specifies whether the default evaluator 620 executes all JavaScript commands in strict mode or default (sloppy) mode. 621 Acceptable values are: 622 * `repl.REPL_MODE_SLOPPY` to evaluate expressions in sloppy mode. 623 * `repl.REPL_MODE_STRICT` to evaluate expressions in strict mode. This is 624 equivalent to prefacing every repl statement with `'use strict'`. 625 * `breakEvalOnSigint` {boolean} Stop evaluating the current piece of code when 626 `SIGINT` is received, such as when <kbd>Ctrl</kbd>+<kbd>C</kbd> is pressed. 627 This cannot be used 628 together with a custom `eval` function. **Default:** `false`. 629 * `preview` {boolean} Defines if the repl prints autocomplete and output 630 previews or not. **Default:** `true` with the default eval function and 631 `false` in case a custom eval function is used. If `terminal` is falsy, then 632 there are no previews and the value of `preview` has no effect. 633* Returns: {repl.REPLServer} 634 635The `repl.start()` method creates and starts a [`repl.REPLServer`][] instance. 636 637If `options` is a string, then it specifies the input prompt: 638 639```js 640const repl = require('repl'); 641 642// a Unix style prompt 643repl.start('$ '); 644``` 645 646## The Node.js REPL 647 648Node.js itself uses the `repl` module to provide its own interactive interface 649for executing JavaScript. This can be used by executing the Node.js binary 650without passing any arguments (or by passing the `-i` argument): 651 652```console 653$ node 654> const a = [1, 2, 3]; 655undefined 656> a 657[ 1, 2, 3 ] 658> a.forEach((v) => { 659... console.log(v); 660... }); 6611 6622 6633 664``` 665 666### Environment variable options 667 668Various behaviors of the Node.js REPL can be customized using the following 669environment variables: 670 671* `NODE_REPL_HISTORY`: When a valid path is given, persistent REPL history 672 will be saved to the specified file rather than `.node_repl_history` in the 673 user's home directory. Setting this value to `''` (an empty string) will 674 disable persistent REPL history. Whitespace will be trimmed from the value. 675 On Windows platforms environment variables with empty values are invalid so 676 set this variable to one or more spaces to disable persistent REPL history. 677* `NODE_REPL_HISTORY_SIZE`: Controls how many lines of history will be 678 persisted if history is available. Must be a positive number. 679 **Default:** `1000`. 680* `NODE_REPL_MODE`: May be either `'sloppy'` or `'strict'`. **Default:** 681 `'sloppy'`, which will allow non-strict mode code to be run. 682 683### Persistent history 684 685By default, the Node.js REPL will persist history between `node` REPL sessions 686by saving inputs to a `.node_repl_history` file located in the user's home 687directory. This can be disabled by setting the environment variable 688`NODE_REPL_HISTORY=''`. 689 690### Using the Node.js REPL with advanced line-editors 691 692For advanced line-editors, start Node.js with the environment variable 693`NODE_NO_READLINE=1`. This will start the main and debugger REPL in canonical 694terminal settings, which will allow use with `rlwrap`. 695 696For example, the following can be added to a `.bashrc` file: 697 698```text 699alias node="env NODE_NO_READLINE=1 rlwrap node" 700``` 701 702### Starting multiple REPL instances against a single running instance 703 704It is possible to create and run multiple REPL instances against a single 705running instance of Node.js that share a single `global` object but have 706separate I/O interfaces. 707 708The following example, for instance, provides separate REPLs on `stdin`, a Unix 709socket, and a TCP socket: 710 711```js 712const net = require('net'); 713const repl = require('repl'); 714let connections = 0; 715 716repl.start({ 717 prompt: 'Node.js via stdin> ', 718 input: process.stdin, 719 output: process.stdout 720}); 721 722net.createServer((socket) => { 723 connections += 1; 724 repl.start({ 725 prompt: 'Node.js via Unix socket> ', 726 input: socket, 727 output: socket 728 }).on('exit', () => { 729 socket.end(); 730 }); 731}).listen('/tmp/node-repl-sock'); 732 733net.createServer((socket) => { 734 connections += 1; 735 repl.start({ 736 prompt: 'Node.js via TCP socket> ', 737 input: socket, 738 output: socket 739 }).on('exit', () => { 740 socket.end(); 741 }); 742}).listen(5001); 743``` 744 745Running this application from the command line will start a REPL on stdin. 746Other REPL clients may connect through the Unix socket or TCP socket. `telnet`, 747for instance, is useful for connecting to TCP sockets, while `socat` can be used 748to connect to both Unix and TCP sockets. 749 750By starting a REPL from a Unix socket-based server instead of stdin, it is 751possible to connect to a long-running Node.js process without restarting it. 752 753For an example of running a "full-featured" (`terminal`) REPL over 754a `net.Server` and `net.Socket` instance, see: 755<https://gist.github.com/TooTallNate/2209310>. 756 757For an example of running a REPL instance over [`curl(1)`][], see: 758<https://gist.github.com/TooTallNate/2053342>. 759 760[TTY keybindings]: readline.md#readline_tty_keybindings 761[ZSH]: https://en.wikipedia.org/wiki/Z_shell 762[`'uncaughtException'`]: process.md#process_event_uncaughtexception 763[`--experimental-repl-await`]: cli.md#cli_experimental_repl_await 764[`ERR_DOMAIN_CANNOT_SET_UNCAUGHT_EXCEPTION_CAPTURE`]: errors.md#errors_err_domain_cannot_set_uncaught_exception_capture 765[`ERR_INVALID_REPL_INPUT`]: errors.md#errors_err_invalid_repl_input 766[`curl(1)`]: https://curl.haxx.se/docs/manpage.html 767[`domain`]: domain.md 768[`process.setUncaughtExceptionCaptureCallback()`]: process.md#process_process_setuncaughtexceptioncapturecallback_fn 769[`readline.InterfaceCompleter`]: readline.md#readline_use_of_the_completer_function 770[`repl.ReplServer`]: #repl_class_replserver 771[`repl.start()`]: #repl_repl_start_options 772[`reverse-i-search`]: #repl_reverse_i_search 773[`util.inspect()`]: util.md#util_util_inspect_object_options 774[stream]: stream.md 775