Provides a customizable Read-Eval-Print-Loop (REPL).

Instances of `repl.REPLServer` will accept individual lines of user input, evaluate those according to a user-defined evaluation function, then output the result. Input and output may be from `stdin` and `stdout`, respectively, or may be connected to any Node.js `stream`.

Instances of `repl.REPLServer` support automatic completion of inputs, simplistic Emacs-style line editing, multi-line inputs, ANSI-styled output, saving and restoring current REPL session state, error recovery, and customizable evaluation functions.

Instances of `repl.REPLServer` are created using the `repl.start()` method and should not be created directly using the JavaScript `new` keyword.

see

  https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_repl

### Hierarchy

- Interface
  - REPLServer

## Index

### Constructors

- constructor

### Properties

- commands
- completer
- context
- editorMode
- eval
- ignoreUndefined
- inputStream
- last
- lastError
- outputStream
- replMode
- terminal
- underscoreAssigned
- underscoreErrAssigned
- useColors
- useGlobal
- writer
- defaultMaxListeners

### Methods

- __@asyncIterator
- addListener
- clearBufferedCommand
- close
- defineCommand
- displayPrompt
- emit
- eventNames
- getMaxListeners
- listenerCount
- listeners
- off
- on
- once
- pause
- prependListener
- prependOnceListener
- prompt
- question
- rawListeners
- removeAllListeners
- removeListener
- resume
- setMaxListeners
- setPrompt
- setupHistory
- write
- listenerCount

## Constructors

### Private constructor

- new REPLServer(): REPLServer

- Overrides Interface.constructor

  - Defined in node_modules/@types/node/repl.d.ts:217

  NOTE: According to the documentation:

  > Instances of `repl.REPLServer` are created using the `repl.start()` method and should not be created directly using the JavaScript `new` keyword.

  `REPLServer` cannot be subclassed due to implementation specifics in NodeJS.

  see

    https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_class_replserver

  #### Returns REPLServer

## Properties

### commands

commands: object

- Defined in node_modules/@types/node/repl.d.ts:144

The commands registered via `replServer.defineCommand()`.

#### Type declaration

- ##### [name: string]: REPLCommand | undefined

### completer

completer: Completer | AsyncCompleter

- Defined in node_modules/@types/node/repl.d.ts:208

Specified in the REPL options, this is the function to use for custom Tab auto-completion.

### context

context: Context

- Defined in node_modules/@types/node/repl.d.ts:132

The `vm.Context` provided to the `eval` function to be used for JavaScript evaluation.

### editorMode

editorMode: boolean

- Defined in node_modules/@types/node/repl.d.ts:150

A value indicating whether the REPL is currently in "editor mode".

see

  https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_commands_and_special_keys

### eval

eval: REPLEval

- Defined in node_modules/@types/node/repl.d.ts:182

Specified in the REPL options, this is the function to be used when evaluating each given line of input. If not specified in the REPL options, this is an async wrapper for the JavaScript `eval()` function.

### ignoreUndefined

ignoreUndefined: boolean

- Defined in node_modules/@types/node/repl.d.ts:198

Specified in the REPL options, this is a value indicating whether the default `writer` function should output the result of a command if it evaluates to `undefined`.

### inputStream

inputStream: ReadableStream

- Defined in node_modules/@types/node/repl.d.ts:136

The `Readable` stream from which REPL input will be read.

### last

last: any

- Defined in node_modules/@types/node/repl.d.ts:162

The last evaluation result from the REPL (assigned to the `_` variable inside of the REPL).

see

  https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable

### lastError

lastError: any

- Defined in node_modules/@types/node/repl.d.ts:176

The last error raised inside the REPL (assigned to the `_error` variable inside of the REPL).

since

  v9.8.0

see

  https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable

### outputStream

outputStream: WritableStream

- Defined in node_modules/@types/node/repl.d.ts:140

The `Writable` stream to which REPL output will be written.

### replMode

replMode: symbol | symbol

- Defined in node_modules/@types/node/repl.d.ts:217

Specified in the REPL options, this is a flag that specifies whether the default `eval` function should execute all JavaScript commands in strict mode or default (sloppy) mode. Possible values are:

- `repl.REPL_MODE_SLOPPY` - evaluates expressions in sloppy mode.
- `repl.REPL_MODE_STRICT` - evaluates expressions in strict mode. This is equivalent to prefacing every repl statement with `'use strict'`.

### terminal

terminal: boolean

Inherited from Interface.terminal

- Defined in node_modules/@types/node/readline.d.ts:14

### underscoreAssigned

underscoreAssigned: boolean

- Defined in node_modules/@types/node/repl.d.ts:156

A value indicating whether the `_` variable has been assigned.

see

  https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable

### underscoreErrAssigned

underscoreErrAssigned: boolean

- Defined in node_modules/@types/node/repl.d.ts:169

A value indicating whether the `_error` variable has been assigned.

since

  v9.8.0

see

  https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable

### useColors

useColors: boolean

- Defined in node_modules/@types/node/repl.d.ts:187

Specified in the REPL options, this is a value indicating whether the default `writer` function should include ANSI color styling to REPL output.

### useGlobal

useGlobal: boolean

- Defined in node_modules/@types/node/repl.d.ts:193

Specified in the REPL options, this is a value indicating whether the default `eval` function will use the JavaScript `global` as the context as opposed to creating a new separate context for the REPL instance.

### writer

writer: REPLWriter

- Defined in node_modules/@types/node/repl.d.ts:204

Specified in the REPL options, this is the function to invoke to format the output of each command before writing to `outputStream`. If not specified in the REPL options, this will be a wrapper for `util.inspect`.

### Static defaultMaxListeners

defaultMaxListeners: number

Inherited from EventEmitter.defaultMaxListeners

- Defined in node_modules/@types/node/events.d.ts:8

## Methods

### __@asyncIterator

- __@asyncIterator(): AsyncIterableIterator<string>

- Inherited from Interface.__@asyncIterator

  - Defined in node_modules/@types/node/readline.d.ts:107

  #### Returns AsyncIterableIterator<string>

### addListener

- addListener(event: string, listener: function): this
- addListener(event: "close", listener: function): this
- addListener(event: "line", listener: function): this
- addListener(event: "pause", listener: function): this
- addListener(event: "resume", listener: function): this
- addListener(event: "SIGCONT", listener: function): this
- addListener(event: "SIGINT", listener: function): this
- addListener(event: "SIGTSTP", listener: function): this
- addListener(event: "exit", listener: function): this
- addListener(event: "reset", listener: function): this

- Overrides Interface.addListener

  - Defined in node_modules/@types/node/repl.d.ts:286

  events.EventEmitter

  1. close - inherited from `readline.Interface`
  2. line - inherited from `readline.Interface`
  3. pause - inherited from `readline.Interface`
  4. resume - inherited from `readline.Interface`
  5. SIGCONT - inherited from `readline.Interface`
  6. SIGINT - inherited from `readline.Interface`
  7. SIGTSTP - inherited from `readline.Interface`
  8. exit
  9. reset

  #### Parameters

  - ##### event: string

  - ##### listener: function

    - - (...args: any[]): void

      - #### Parameters

        - ##### Rest ...args: any[]

        #### Returns void

  #### Returns this

- Overrides Interface.addListener

  - Defined in node_modules/@types/node/repl.d.ts:287

  #### Parameters

  - ##### event: "close"

  - ##### listener: function

    - - (): void

      - #### Returns void

  #### Returns this

- Overrides Interface.addListener

  - Defined in node_modules/@types/node/repl.d.ts:288

  #### Parameters

  - ##### event: "line"

  - ##### listener: function

    - - (input: string): void

      - #### Parameters

        - ##### input: string

        #### Returns void

  #### Returns this

- Overrides Interface.addListener

  - Defined in node_modules/@types/node/repl.d.ts:289

  #### Parameters

  - ##### event: "pause"

  - ##### listener: function

    - - (): void

      - #### Returns void

  #### Returns this

- Overrides Interface.addListener

  - Defined in node_modules/@types/node/repl.d.ts:290

  #### Parameters

  - ##### event: "resume"

  - ##### listener: function

    - - (): void

      - #### Returns void

  #### Returns this

- Overrides Interface.addListener

  - Defined in node_modules/@types/node/repl.d.ts:291

  #### Parameters

  - ##### event: "SIGCONT"

  - ##### listener: function

    - - (): void

      - #### Returns void

  #### Returns this

- Overrides Interface.addListener

  - Defined in node_modules/@types/node/repl.d.ts:292

  #### Parameters

  - ##### event: "SIGINT"

  - ##### listener: function

    - - (): void

      - #### Returns void

  #### Returns this

- Overrides Interface.addListener

  - Defined in node_modules/@types/node/repl.d.ts:293

  #### Parameters

  - ##### event: "SIGTSTP"

  - ##### listener: function

    - - (): void

      - #### Returns void

  #### Returns this

- Overrides Interface.addListener

  - Defined in node_modules/@types/node/repl.d.ts:294

  #### Parameters

  - ##### event: "exit"

  - ##### listener: function

    - - (): void

      - #### Returns void

  #### Returns this

- Overrides Interface.addListener

  - Defined in node_modules/@types/node/repl.d.ts:295

  #### Parameters

  - ##### event: "reset"

  - ##### listener: function

    - - (context: Context): void

      - #### Parameters

        - ##### context: Context

        #### Returns void

  #### Returns this

### clearBufferedCommand

- clearBufferedCommand(): void

- - Defined in node_modules/@types/node/repl.d.ts:261

  Clears any command that has been buffered but not yet executed.

  This method is primarily intended to be called from within the action function for commands registered using the `replServer.defineCommand()` method.

  since

    v9.0.0

  #### Returns void

### close

- close(): void

- Inherited from Interface.close

  - Defined in node_modules/@types/node/readline.d.ts:40

  #### Returns void

### defineCommand

- defineCommand(keyword: string, cmd: REPLCommandAction | REPLCommand): void

- - Defined in node_modules/@types/node/repl.d.ts:240

  Used to add new `.`-prefixed commands to the REPL instance. Such commands are invoked by typing a `.` followed by the `keyword`.

  see

    https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_replserver_definecommand_keyword_cmd

  #### Parameters

  - ##### keyword: string

    The command keyword (without a leading `.` character).

  - ##### cmd: REPLCommandAction | REPLCommand

    The function to invoke when the command is processed.

  #### Returns void

### displayPrompt

- displayPrompt(preserveCursor?: undefined | false | true): void

- - Defined in node_modules/@types/node/repl.d.ts:252

  Readies the REPL instance for input from the user, printing the configured `prompt` to a new line in the `output` and resuming the `input` to accept new input.

  When multi-line input is being entered, an ellipsis is printed rather than the 'prompt'.

  This method is primarily intended to be called from within the action function for commands registered using the `replServer.defineCommand()` method.

  #### Parameters

  - ##### Optional preserveCursor: undefined | false | true

    When `true`, the cursor placement will not be reset to `0`.

  #### Returns void

### emit

- emit(event: string | symbol, ...args: any[]): boolean
- emit(event: "close"): boolean
- emit(event: "line", input: string): boolean
- emit(event: "pause"): boolean
- emit(event: "resume"): boolean
- emit(event: "SIGCONT"): boolean
- emit(event: "SIGINT"): boolean
- emit(event: "SIGTSTP"): boolean
- emit(event: "exit"): boolean
- emit(event: "reset", context: Context): boolean

- Overrides Interface.emit

  - Defined in node_modules/@types/node/repl.d.ts:297

  #### Parameters

  - ##### event: string | symbol

  - ##### Rest ...args: any[]

  #### Returns boolean

- Overrides Interface.emit

  - Defined in node_modules/@types/node/repl.d.ts:298

  #### Parameters

  - ##### event: "close"

  #### Returns boolean

- Overrides Interface.emit

  - Defined in node_modules/@types/node/repl.d.ts:299

  #### Parameters

  - ##### event: "line"

  - ##### input: string

  #### Returns boolean

- Overrides Interface.emit

  - Defined in node_modules/@types/node/repl.d.ts:300

  #### Parameters

  - ##### event: "pause"

  #### Returns boolean

- Overrides Interface.emit

  - Defined in node_modules/@types/node/repl.d.ts:301

  #### Parameters

  - ##### event: "resume"

  #### Returns boolean

- Overrides Interface.emit

  - Defined in node_modules/@types/node/repl.d.ts:302

  #### Parameters

  - ##### event: "SIGCONT"

  #### Returns boolean

- Overrides Interface.emit

  - Defined in node_modules/@types/node/repl.d.ts:303

  #### Parameters

  - ##### event: "SIGINT"

  #### Returns boolean

- Overrides Interface.emit

  - Defined in node_modules/@types/node/repl.d.ts:304

  #### Parameters

  - ##### event: "SIGTSTP"

  #### Returns boolean

- Overrides Interface.emit

  - Defined in node_modules/@types/node/repl.d.ts:305

  #### Parameters

  - ##### event: "exit"

  #### Returns boolean

- Overrides Interface.emit

  - Defined in node_modules/@types/node/repl.d.ts:306

  #### Parameters

  - ##### event: "reset"

  - ##### context: Context

  #### Returns boolean

### eventNames

- eventNames(): Array<string | symbol>

- Inherited from EventEmitter.eventNames

  Overrides EventEmitter.eventNames

  - Defined in node_modules/@types/node/events.d.ts:23

  #### Returns Array<string | symbol>

### getMaxListeners

- getMaxListeners(): number

- Inherited from EventEmitter.getMaxListeners

  Overrides EventEmitter.getMaxListeners

  - Defined in node_modules/@types/node/events.d.ts:19

  #### Returns number

### listenerCount

- listenerCount(type: string | symbol): number

- Inherited from EventEmitter.listenerCount

  Overrides EventEmitter.listenerCount

  - Defined in node_modules/@types/node/events.d.ts:24

  #### Parameters

  - ##### type: string | symbol

  #### Returns number

### listeners

- listeners(event: string | symbol): Function[]

- Inherited from EventEmitter.listeners

  Overrides EventEmitter.listeners

  - Defined in node_modules/@types/node/events.d.ts:20

  #### Parameters

  - ##### event: string | symbol

  #### Returns Function[]

### off

- off(event: string | symbol, listener: function): this

- Inherited from EventEmitter.off

  Overrides EventEmitter.off

  - Defined in node_modules/@types/node/events.d.ts:16

  #### Parameters

  - ##### event: string | symbol

  - ##### listener: function

    - - (...args: any[]): void

      - #### Parameters

        - ##### Rest ...args: any[]

        #### Returns void

  #### Returns this

### on

- on(event: string, listener: function): this
- on(event: "close", listener: function): this
- on(event: "line", listener: function): this
- on(event: "pause", listener: function): this
- on(event: "resume", listener: function): this
- on(event: "SIGCONT", listener: function): this
- on(event: "SIGINT", listener: function): this
- on(event: "SIGTSTP", listener: function): this
- on(event: "exit", listener: function): this
- on(event: "reset", listener: function): this

- Overrides Interface.on

  - Defined in node_modules/@types/node/repl.d.ts:308

  #### Parameters

  - ##### event: string

  - ##### listener: function

    - - (...args: any[]): void

      - #### Parameters

        - ##### Rest ...args: any[]

        #### Returns void

  #### Returns this

- Overrides Interface.on

  - Defined in node_modules/@types/node/repl.d.ts:309

  #### Parameters

  - ##### event: "close"

  - ##### listener: function

    - - (): void

      - #### Returns void

  #### Returns this

- Overrides Interface.on

  - Defined in node_modules/@types/node/repl.d.ts:310

  #### Parameters

  - ##### event: "line"

  - ##### listener: function

    - - (input: string): void

      - #### Parameters

        - ##### input: string

        #### Returns void

  #### Returns this

- Overrides Interface.on

  - Defined in node_modules/@types/node/repl.d.ts:311

  #### Parameters

  - ##### event: "pause"

  - ##### listener: function

    - - (): void

      - #### Returns void

  #### Returns this

- Overrides Interface.on

  - Defined in node_modules/@types/node/repl.d.ts:312

  #### Parameters

  - ##### event: "resume"

  - ##### listener: function

    - - (): void

      - #### Returns void

  #### Returns this

- Overrides Interface.on

  - Defined in node_modules/@types/node/repl.d.ts:313

  #### Parameters

  - ##### event: "SIGCONT"

  - ##### listener: function

    - - (): void

      - #### Returns void

  #### Returns this

- Overrides Interface.on

  - Defined in node_modules/@types/node/repl.d.ts:314

  #### Parameters

  - ##### event: "SIGINT"

  - ##### listener: function

    - - (): void

      - #### Returns void

  #### Returns this

- Overrides Interface.on

  - Defined in node_modules/@types/node/repl.d.ts:315

  #### Parameters

  - ##### event: "SIGTSTP"

  - ##### listener: function

    - - (): void

      - #### Returns void

  #### Returns this

- Overrides Interface.on

  - Defined in node_modules/@types/node/repl.d.ts:316

  #### Parameters

  - ##### event: "exit"

  - ##### listener: function

    - - (): void

      - #### Returns void

  #### Returns this

- Overrides Interface.on

  - Defined in node_modules/@types/node/repl.d.ts:317

  #### Parameters

  - ##### event: "reset"

  - ##### listener: function

    - - (context: Context): void

      - #### Parameters

        - ##### context: Context

        #### Returns void

  #### Returns this

### once

- once(event: string, listener: function): this
- once(event: "close", listener: function): this
- once(event: "line", listener: function): this
- once(event: "pause", listener: function): this
- once(event: "resume", listener: function): this
- once(event: "SIGCONT", listener: function): this
- once(event: "SIGINT", listener: function): this
- once(event: "SIGTSTP", listener: function): this
- once(event: "exit", listener: function): this
- once(event: "reset", listener: function): this

- Overrides Interface.once

  - Defined in node_modules/@types/node/repl.d.ts:319

  #### Parameters

  - ##### event: string

  - ##### listener: function

    - - (...args: any[]): void

      - #### Parameters

        - ##### Rest ...args: any[]

        #### Returns void

  #### Returns this

- Overrides Interface.once

  - Defined in node_modules/@types/node/repl.d.ts:320

  #### Parameters

  - ##### event: "close"

  - ##### listener: function

    - - (): void

      - #### Returns void

  #### Returns this

- Overrides Interface.once

  - Defined in node_modules/@types/node/repl.d.ts:321

  #### Parameters

  - ##### event: "line"

  - ##### listener: function

    - - (input: string): void

      - #### Parameters

        - ##### input: string

        #### Returns void

  #### Returns this

- Overrides Interface.once

  - Defined in node_modules/@types/node/repl.d.ts:322

  #### Parameters

  - ##### event: "pause"

  - ##### listener: function

    - - (): void

      - #### Returns void

  #### Returns this

- Overrides Interface.once

  - Defined in node_modules/@types/node/repl.d.ts:323

  #### Parameters

  - ##### event: "resume"

  - ##### listener: function

    - - (): void

      - #### Returns void

  #### Returns this

- Overrides Interface.once

  - Defined in node_modules/@types/node/repl.d.ts:324

  #### Parameters

  - ##### event: "SIGCONT"

  - ##### listener: function

    - - (): void

      - #### Returns void

  #### Returns this

- Overrides Interface.once

  - Defined in node_modules/@types/node/repl.d.ts:325

  #### Parameters

  - ##### event: "SIGINT"

  - ##### listener: function

    - - (): void

      - #### Returns void

  #### Returns this

- Overrides Interface.once

  - Defined in node_modules/@types/node/repl.d.ts:326

  #### Parameters

  - ##### event: "SIGTSTP"

  - ##### listener: function

    - - (): void

      - #### Returns void

  #### Returns this

- Overrides Interface.once

  - Defined in node_modules/@types/node/repl.d.ts:327

  #### Parameters

  - ##### event: "exit"

  - ##### listener: function

    - - (): void

      - #### Returns void

  #### Returns this

- Overrides Interface.once

  - Defined in node_modules/@types/node/repl.d.ts:328

  #### Parameters

  - ##### event: "reset"

  - ##### listener: function

    - - (context: Context): void

      - #### Parameters

        - ##### context: Context

        #### Returns void

  #### Returns this

### pause

- pause(): this

- Inherited from Interface.pause

  - Defined in node_modules/@types/node/readline.d.ts:38

  #### Returns this

### prependListener

- prependListener(event: string, listener: function): this
- prependListener(event: "close", listener: function): this
- prependListener(event: "line", listener: function): this
- prependListener(event: "pause", listener: function): this
- prependListener(event: "resume", listener: function): this
- prependListener(event: "SIGCONT", listener: function): this
- prependListener(event: "SIGINT", listener: function): this
- prependListener(event: "SIGTSTP", listener: function): this
- prependListener(event: "exit", listener: function): this
- prependListener(event: "reset", listener: function): this

- Overrides Interface.prependListener

  - Defined in node_modules/@types/node/repl.d.ts:330

  #### Parameters

  - ##### event: string

  - ##### listener: function

    - - (...args: any[]): void

      - #### Parameters

        - ##### Rest ...args: any[]

        #### Returns void

  #### Returns this

- Overrides Interface.prependListener

  - Defined in node_modules/@types/node/repl.d.ts:331

  #### Parameters

  - ##### event: "close"

  - ##### listener: function

    - - (): void

      - #### Returns void

  #### Returns this

- Overrides Interface.prependListener

  - Defined in node_modules/@types/node/repl.d.ts:332

  #### Parameters

  - ##### event: "line"

  - ##### listener: function

    - - (input: string): void

      - #### Parameters

        - ##### input: string

        #### Returns void

  #### Returns this

- Overrides Interface.prependListener

  - Defined in node_modules/@types/node/repl.d.ts:333

  #### Parameters

  - ##### event: "pause"

  - ##### listener: function

    - - (): void

      - #### Returns void

  #### Returns this

- Overrides Interface.prependListener

  - Defined in node_modules/@types/node/repl.d.ts:334

  #### Parameters

  - ##### event: "resume"

  - ##### listener: function

    - - (): void

      - #### Returns void

  #### Returns this

- Overrides Interface.prependListener

  - Defined in node_modules/@types/node/repl.d.ts:335

  #### Parameters

  - ##### event: "SIGCONT"

  - ##### listener: function

    - - (): void

      - #### Returns void

  #### Returns this

- Overrides Interface.prependListener

  - Defined in node_modules/@types/node/repl.d.ts:336

  #### Parameters

  - ##### event: "SIGINT"

  - ##### listener: function

    - - (): void

      - #### Returns void

  #### Returns this

- Overrides Interface.prependListener

  - Defined in node_modules/@types/node/repl.d.ts:337

  #### Parameters

  - ##### event: "SIGTSTP"

  - ##### listener: function

    - - (): void

      - #### Returns void

  #### Returns this

- Overrides Interface.prependListener

  - Defined in node_modules/@types/node/repl.d.ts:338

  #### Parameters

  - ##### event: "exit"

  - ##### listener: function

    - - (): void

      - #### Returns void

  #### Returns this

- Overrides Interface.prependListener

  - Defined in node_modules/@types/node/repl.d.ts:339

  #### Parameters

  - ##### event: "reset"

  - ##### listener: function

    - - (context: Context): void

      - #### Parameters

        - ##### context: Context

        #### Returns void

  #### Returns this

### prependOnceListener

- prependOnceListener(event: string, listener: function): this
- prependOnceListener(event: "close", listener: function): this
- prependOnceListener(event: "line", listener: function): this
- prependOnceListener(event: "pause", listener: function): this
- prependOnceListener(event: "resume", listener: function): this
- prependOnceListener(event: "SIGCONT", listener: function): this
- prependOnceListener(event: "SIGINT", listener: function): this
- prependOnceListener(event: "SIGTSTP", listener: function): this
- prependOnceListener(event: "exit", listener: function): this
- prependOnceListener(event: "reset", listener: function): this

- Overrides Interface.prependOnceListener

  - Defined in node_modules/@types/node/repl.d.ts:341

  #### Parameters

  - ##### event: string

  - ##### listener: function

    - - (...args: any[]): void

      - #### Parameters

        - ##### Rest ...args: any[]

        #### Returns void

  #### Returns this

- Overrides Interface.prependOnceListener

  - Defined in node_modules/@types/node/repl.d.ts:342

  #### Parameters

  - ##### event: "close"

  - ##### listener: function

    - - (): void

      - #### Returns void

  #### Returns this

- Overrides Interface.prependOnceListener

  - Defined in node_modules/@types/node/repl.d.ts:343

  #### Parameters

  - ##### event: "line"

  - ##### listener: function

    - - (input: string): void

      - #### Parameters

        - ##### input: string

        #### Returns void

  #### Returns this

- Overrides Interface.prependOnceListener

  - Defined in node_modules/@types/node/repl.d.ts:344

  #### Parameters

  - ##### event: "pause"

  - ##### listener: function

    - - (): void

      - #### Returns void

  #### Returns this

- Overrides Interface.prependOnceListener

  - Defined in node_modules/@types/node/repl.d.ts:345

  #### Parameters

  - ##### event: "resume"

  - ##### listener: function

    - - (): void

      - #### Returns void

  #### Returns this

- Overrides Interface.prependOnceListener

  - Defined in node_modules/@types/node/repl.d.ts:346

  #### Parameters

  - ##### event: "SIGCONT"

  - ##### listener: function

    - - (): void

      - #### Returns void

  #### Returns this

- Overrides Interface.prependOnceListener

  - Defined in node_modules/@types/node/repl.d.ts:347

  #### Parameters

  - ##### event: "SIGINT"

  - ##### listener: function

    - - (): void

      - #### Returns void

  #### Returns this

- Overrides Interface.prependOnceListener

  - Defined in node_modules/@types/node/repl.d.ts:348

  #### Parameters

  - ##### event: "SIGTSTP"

  - ##### listener: function

    - - (): void

      - #### Returns void

  #### Returns this

- Overrides Interface.prependOnceListener

  - Defined in node_modules/@types/node/repl.d.ts:349

  #### Parameters

  - ##### event: "exit"

  - ##### listener: function

    - - (): void

      - #### Returns void

  #### Returns this

- Overrides Interface.prependOnceListener

  - Defined in node_modules/@types/node/repl.d.ts:350

  #### Parameters

  - ##### event: "reset"

  - ##### listener: function

    - - (context: Context): void

      - #### Parameters

        - ##### context: Context

        #### Returns void

  #### Returns this

### prompt

- prompt(preserveCursor?: undefined | false | true): void

- Inherited from Interface.prompt

  - Defined in node_modules/@types/node/readline.d.ts:36

  #### Parameters

  - ##### Optional preserveCursor: undefined | false | true

  #### Returns void

### question

- question(query: string, callback: function): void

- Inherited from Interface.question

  - Defined in node_modules/@types/node/readline.d.ts:37

  #### Parameters

  - ##### query: string

  - ##### callback: function

    - - (answer: string): void

      - #### Parameters

        - ##### answer: string

        #### Returns void

### rawListeners

- rawListeners(event: string | symbol): Function[]

- Inherited from EventEmitter.rawListeners

  Overrides EventEmitter.rawListeners

  - Defined in node_modules/@types/node/events.d.ts:21

  #### Parameters

  - ##### event: string | symbol

  #### Returns Function[]

### removeAllListeners

- removeAllListeners(event?: string | symbol): this

- Inherited from EventEmitter.removeAllListeners

  Overrides EventEmitter.removeAllListeners

  - Defined in node_modules/@types/node/events.d.ts:17

  #### Parameters

  - ##### Optional event: string | symbol

  #### Returns this

### removeListener

- removeListener(event: string | symbol, listener: function): this

- Inherited from EventEmitter.removeListener

  Overrides EventEmitter.removeListener

  - Defined in node_modules/@types/node/events.d.ts:15

  #### Parameters

  - ##### event: string | symbol

  - ##### listener: function

    - - (...args: any[]): void

      - #### Parameters

        - ##### Rest ...args: any[]

        #### Returns void

  #### Returns this

### resume

- resume(): this

- Inherited from Interface.resume

  - Defined in node_modules/@types/node/readline.d.ts:39

  #### Returns this

### setMaxListeners

- setMaxListeners(n: number): this

- Inherited from EventEmitter.setMaxListeners

  Overrides EventEmitter.setMaxListeners

  - Defined in node_modules/@types/node/events.d.ts:18

  #### Parameters

  - ##### n: number

  #### Returns this

### setPrompt

- setPrompt(prompt: string): void

- Inherited from Interface.setPrompt

  - Defined in node_modules/@types/node/readline.d.ts:35

  #### Parameters

  - ##### prompt: string

  #### Returns void

### setupHistory

- setupHistory(path: string, cb: function): void

- - Defined in node_modules/@types/node/repl.d.ts:271

  Initializes a history log file for the REPL instance. When executing the Node.js binary and using the command line REPL, a history file is initialized by default. However, this is not the case when creating a REPL programmatically. Use this method to initialize a history log file when working with REPL instances programmatically.

  #### Parameters

  - ##### path: string

    The path to the history file

  - ##### cb: function

    - - (err: Error | null, repl: this): void

      - #### Parameters

        - ##### err: Error | null

        - ##### repl: this

        #### Returns void

### write

- write(data: string | Buffer, key?: Key): void

- Inherited from Interface.write

  - Defined in node_modules/@types/node/readline.d.ts:41

  #### Parameters

  - ##### data: string | Buffer

  - ##### Optional key: Key

  #### Returns void

### Static listenerCount

- listenerCount(emitter: EventEmitter, event: string | symbol): number

- Inherited from EventEmitter.listenerCount

  - Defined in node_modules/@types/node/events.d.ts:7
  deprecated

    since v4.0.0

  #### Parameters

  - ##### emitter: EventEmitter

  - ##### event: string | symbol

  #### Returns number

Generated using TypeDoc