Readline

external class Readline(source)

Since

v17.0.0

Constructors

Link copied to clipboard
constructor(stream: WritableStream, options: ReadlineOptions = definedExternally)

Functions

Link copied to clipboard
external fun clearLine(dir: Direction)

The rl.clearLine() method adds to the internal list of pending action an action that clears current line of the associated stream in a specified direction identified by dir. Call rl.commit() to see the effect of this method, unless autoCommit: true was passed to the constructor.

Link copied to clipboard
external fun clearScreenDown()

The rl.clearScreenDown() method adds to the internal list of pending action an action that clears the associated stream from the current position of the cursor down. Call rl.commit() to see the effect of this method, unless autoCommit: true was passed to the constructor.

Link copied to clipboard
suspend external fun commit(): Void
Link copied to clipboard
external fun commitAsync(): Promise<Void>

The rl.commit() method sends all the pending actions to the associated stream and clears the internal list of pending actions.

Link copied to clipboard
external fun cursorTo(x: Number, y: Number = definedExternally)

The rl.cursorTo() method adds to the internal list of pending action an action that moves cursor to the specified position in the associated stream. Call rl.commit() to see the effect of this method, unless autoCommit: true was passed to the constructor.

Link copied to clipboard
external fun moveCursor(dx: Number, dy: Number)

The rl.moveCursor() method adds to the internal list of pending action an action that moves the cursor relative to its current position in the associated stream. Call rl.commit() to see the effect of this method, unless autoCommit: true was passed to the constructor.

Link copied to clipboard
external fun rollback()

The rl.rollback methods clears the internal list of pending actions without sending it to the associated stream.