Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: add added: information for repl #7256

Merged
merged 1 commit into from
Jun 18, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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