@@ -214,12 +214,18 @@ function myWriter(output) {
214
214
```
215
215
216
216
## Class: REPLServer
217
+ <!-- YAML
218
+ added: v0.1.91
219
+ -->
217
220
218
221
The ` repl.REPLServer ` class inherits from the [ ` readline.Interface ` ] [ ] class.
219
222
Instances of ` repl.REPLServer ` are created using the ` repl.start() ` method and
220
223
* should not* be created directly using the JavaScript ` new ` keyword.
221
224
222
225
### Event: 'exit'
226
+ <!-- YAML
227
+ added: v0.7.7
228
+ -->
223
229
224
230
The ` 'exit' ` event is emitted when the REPL is exited either by receiving the
225
231
` .exit ` command as input, the user pressing ` <ctrl>-C ` twice to signal ` SIGINT ` ,
@@ -234,6 +240,9 @@ replServer.on('exit', () => {
234
240
```
235
241
236
242
### Event: 'reset'
243
+ <!-- YAML
244
+ added: v0.11.0
245
+ -->
237
246
238
247
The ` 'reset' ` event is emitted when the REPL's context is reset. This occurs
239
248
whenever the ` .clear ` command is received as input * unless* the REPL is using
@@ -276,6 +285,9 @@ Clearing context...
276
285
```
277
286
278
287
### replServer.defineCommand(keyword, cmd)
288
+ <!-- YAML
289
+ added: v0.3.0
290
+ -->
279
291
280
292
* ` keyword ` {String} The command keyword (* without* a leading ` . ` character).
281
293
* ` cmd ` {Object|Function} The function to invoke when the command is processed.
@@ -320,6 +332,9 @@ Goodbye!
320
332
```
321
333
322
334
### replServer.displayPrompt([ preserveCursor] )
335
+ <!-- YAML
336
+ added: v0.1.91
337
+ -->
323
338
324
339
* ` preserveCursor ` {Boolean}
325
340
@@ -337,6 +352,9 @@ within the action function for commands registered using the
337
352
` replServer.defineCommand() ` method.
338
353
339
354
## repl.start([ options] )
355
+ <!-- YAML
356
+ added: v0.1.91
357
+ -->
340
358
341
359
* ` options ` {Object}
342
360
* ` prompt ` {String} The input prompt to display. Defaults to ` > ` .
@@ -419,6 +437,10 @@ directory. This can be disabled by setting the environment variable
419
437
` NODE_REPL_HISTORY="" ` .
420
438
421
439
#### NODE_REPL_HISTORY_FILE
440
+ <!-- YAML
441
+ added: v2.0.0
442
+ deprecated: v3.0.0
443
+ -->
422
444
423
445
Stability: 0 - Deprecated: Use ` NODE_REPL_HISTORY ` instead.
424
446
0 commit comments