Skip to content

Commit

Permalink
doc: add added: information for repl
Browse files Browse the repository at this point in the history
Ref: #6578
PR-URL: #7256
Reviewed-By: Julian Duque <julianduquej@gmail.com>
  • Loading branch information
addaleax committed Jun 18, 2016
1 parent 6a93ab1 commit 740d8cf
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions doc/api/repl.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,12 +214,18 @@ function myWriter(output) {
```

## Class: REPLServer
<!-- YAML
added: v0.1.91
-->

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'
<!-- YAML
added: v0.7.7
-->

The `'exit'` event is emitted when the REPL is exited either by receiving the
`.exit` command as input, the user pressing `<ctrl>-C` twice to signal `SIGINT`,
Expand All @@ -234,6 +240,9 @@ replServer.on('exit', () => {
```

### Event: 'reset'
<!-- YAML
added: v0.11.0
-->

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
Expand Down Expand Up @@ -276,6 +285,9 @@ Clearing context...
```

### replServer.defineCommand(keyword, cmd)
<!-- YAML
added: v0.3.0
-->

* `keyword` {String} The command keyword (*without* a leading `.` character).
* `cmd` {Object|Function} The function to invoke when the command is processed.
Expand Down Expand Up @@ -320,6 +332,9 @@ Goodbye!
```

### replServer.displayPrompt([preserveCursor])
<!-- YAML
added: v0.1.91
-->

* `preserveCursor` {Boolean}

Expand All @@ -337,6 +352,9 @@ within the action function for commands registered using the
`replServer.defineCommand()` method.

## repl.start([options])
<!-- YAML
added: v0.1.91
-->

* `options` {Object}
* `prompt` {String} The input prompt to display. Defaults to `> `.
Expand Down Expand Up @@ -419,6 +437,10 @@ directory. This can be disabled by setting the environment variable
`NODE_REPL_HISTORY=""`.

#### NODE_REPL_HISTORY_FILE
<!-- YAML
added: v2.0.0
deprecated: v3.0.0
-->

Stability: 0 - Deprecated: Use `NODE_REPL_HISTORY` instead.

Expand Down

0 comments on commit 740d8cf

Please sign in to comment.