Go to Latest
method Interface.prototype.write
import { Interface } from "https://dotland.deno.dev/std@0.177.0/node/readline.ts";

The rl.write() method will write either data or a key sequence identified by key to the output. The key argument is supported only if output is a TTY text terminal. See TTY keybindings for a list of key combinations.

If key is specified, data is ignored.

When called, rl.write() will resume the input stream if it has been paused.

If the readline.Interface was created with output set to null orundefined the data and key are not written.

rl.write('Delete this!');
// Simulate Ctrl+U to delete the line written previously
rl.write(null, { ctrl: true, name: 'u' });

The rl.write() method will write the data to the readline Interface'sinput_as if it were provided by the user_.

Parameters

data: string | Buffer
optional
key: Key

Parameters

data:
| undefined
| null
| string
| Buffer
key: Key