diff --git a/doc/api/repl.md b/doc/api/repl.md index d2f50ecd2898bf..7524a373eea366 100644 --- a/doc/api/repl.md +++ b/doc/api/repl.md @@ -214,12 +214,18 @@ function myWriter(output) { ``` ## Class: REPLServer + The `repl.REPLServer` class inherits from the [`readline.Interface`][] class. Instances of `repl.REPLServer` are created using the `repl.start()` method and *should not* be created directly using the JavaScript `new` keyword. ### Event: 'exit' + The `'exit'` event is emitted when the REPL is exited either by receiving the `.exit` command as input, the user pressing `-C` twice to signal `SIGINT`, @@ -234,6 +240,9 @@ replServer.on('exit', () => { ``` ### Event: 'reset' + The `'reset'` event is emitted when the REPL's context is reset. This occurs whenever the `.clear` command is received as input *unless* the REPL is using @@ -276,6 +285,9 @@ Clearing context... ``` ### replServer.defineCommand(keyword, cmd) + * `keyword` {String} The command keyword (*without* a leading `.` character). * `cmd` {Object|Function} The function to invoke when the command is processed. @@ -320,6 +332,9 @@ Goodbye! ``` ### replServer.displayPrompt([preserveCursor]) + * `preserveCursor` {Boolean} @@ -337,6 +352,9 @@ within the action function for commands registered using the `replServer.defineCommand()` method. ## repl.start([options]) + * `options` {Object} * `prompt` {String} The input prompt to display. Defaults to `> `. @@ -419,6 +437,10 @@ directory. This can be disabled by setting the environment variable `NODE_REPL_HISTORY=""`. #### NODE_REPL_HISTORY_FILE + Stability: 0 - Deprecated: Use `NODE_REPL_HISTORY` instead.