Skip to content

Commit 740d8cf

Browse files
committed
doc: add added: information for repl
Ref: #6578 PR-URL: #7256 Reviewed-By: Julian Duque <[email protected]>
1 parent 6a93ab1 commit 740d8cf

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

doc/api/repl.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,12 +214,18 @@ function myWriter(output) {
214214
```
215215

216216
## Class: REPLServer
217+
<!-- YAML
218+
added: v0.1.91
219+
-->
217220

218221
The `repl.REPLServer` class inherits from the [`readline.Interface`][] class.
219222
Instances of `repl.REPLServer` are created using the `repl.start()` method and
220223
*should not* be created directly using the JavaScript `new` keyword.
221224

222225
### Event: 'exit'
226+
<!-- YAML
227+
added: v0.7.7
228+
-->
223229

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

236242
### Event: 'reset'
243+
<!-- YAML
244+
added: v0.11.0
245+
-->
237246

238247
The `'reset'` event is emitted when the REPL's context is reset. This occurs
239248
whenever the `.clear` command is received as input *unless* the REPL is using
@@ -276,6 +285,9 @@ Clearing context...
276285
```
277286

278287
### replServer.defineCommand(keyword, cmd)
288+
<!-- YAML
289+
added: v0.3.0
290+
-->
279291

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

322334
### replServer.displayPrompt([preserveCursor])
335+
<!-- YAML
336+
added: v0.1.91
337+
-->
323338

324339
* `preserveCursor` {Boolean}
325340

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

339354
## repl.start([options])
355+
<!-- YAML
356+
added: v0.1.91
357+
-->
340358

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

421439
#### NODE_REPL_HISTORY_FILE
440+
<!-- YAML
441+
added: v2.0.0
442+
deprecated: v3.0.0
443+
-->
422444

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

0 commit comments

Comments
 (0)