ReplOptions

sealed external interface ReplOptions(source)

Properties

Link copied to clipboard
abstract var breakEvalOnSigint: Boolean?

Stop evaluating the current piece of code when SIGINT is received, i.e. Ctrl+C is pressed. This cannot be used together with a custom eval function.

Link copied to clipboard
abstract var completer: Any?

An optional function used for custom Tab auto completion.

Link copied to clipboard
abstract var eval: REPLEval?

The function to be used when evaluating each given line of input. Default: an async wrapper for the JavaScript eval() function. An eval function can error with repl.Recoverable to indicate the input was incomplete and prompt for additional lines.

Link copied to clipboard
abstract var ignoreUndefined: Boolean?

If true, specifies that the default writer will not output the return value of a command if it evaluates to undefined.

Link copied to clipboard
abstract var input: ReadableStream?

The Readable stream from which REPL input will be read.

Link copied to clipboard
abstract var output: WritableStream?

The Writable stream to which REPL output will be written.

Link copied to clipboard
abstract var preview: Boolean?

Defines if the repl prints output previews or not.

Link copied to clipboard
abstract var prompt: String?

The input prompt to display.

Link copied to clipboard
abstract var replMode: Any?

A flag that specifies whether the default evaluator executes all JavaScript commands in strict mode or default (sloppy) mode. Accepted values are:

Link copied to clipboard
abstract var terminal: Boolean?

If true, specifies that the output should be treated as a TTY terminal, and have ANSI/VT100 escape codes written to it. Default: checking the value of the isTTY property on the output stream upon instantiation.

Link copied to clipboard
abstract var useColors: Boolean?

If true, specifies that the default writer function should include ANSI color styling to REPL output. If a custom writer function is provided then this has no effect.

Link copied to clipboard
abstract var useGlobal: Boolean?

If true, specifies that the default evaluation function will use the JavaScript global as the context as opposed to creating a new separate context for the REPL instance. The node CLI REPL sets this value to true.

Link copied to clipboard
abstract var writer: REPLWriter?

The function to invoke to format the output of each command before writing to output.