Skip to main content

Interface: InterfaceOptions

Options for creating a readline interface.

Properties

colorize()?

optional colorize: (line) => ColorToken[]

Function called to colorize the current line for display.

Parameters

line

string

Returns

ColorToken[]


completer()?

optional completer: (line, cursor) => CompleterResult | Promise<CompleterResult>

Async function called for tab completion.

Parameters

line

string

cursor

number

Returns

CompleterResult | Promise<CompleterResult>


historySize?

optional historySize: number

Maximum number of history entries. Set to 0 to disable. Default: 100.


input

input: ReadableStream<Uint8Array>

The input stream to read from.


multiline?

optional multiline: boolean

If true, Enter inserts a newline and Ctrl+D submits. Default: false.


output

output: WritableStream<Uint8Array>

The output stream to write to.


prompt?

optional prompt: string

The prompt string to display. Default: '> '.


terminal?

optional terminal: boolean

Whether the input is a terminal. Auto-detected from input if not specified.