From 6aa179b4a6c53000e932dac06fdf28a2e288f009 Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Fri, 10 Jun 2016 09:12:55 +0200 Subject: [PATCH] doc: add `added:` information for repl Ref: https://github.com/nodejs/node/issues/6578 PR-URL: https://github.com/nodejs/node/pull/7256 Reviewed-By: Julian Duque --- doc/api/repl.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/doc/api/repl.md b/doc/api/repl.md index 5437880eb36827..0c3c1b10e9ab1c 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 `> `. @@ -416,6 +434,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.