createInterface
Call Signature
Section titled “Call Signature”createInterface(
input,output?,completer?,terminal?):ReadLineInterface
Defined in: _worktrees/docs-release/gaunt-sloth/node_modules/.pnpm/@types+node@26.1.2/node_modules/@types/node/readline/promises.d.ts:148
The readlinePromises.createInterface() method creates a new readlinePromises.Interface instance.
import readlinePromises from 'node:readline/promises';const rl = readlinePromises.createInterface({ input: process.stdin, output: process.stdout,});Once the readlinePromises.Interface instance is created, the most common case
is to listen for the 'line' event:
rl.on('line', (line) => { console.log(`Received: ${line}`);});If terminal is true for this instance then the output stream will get
the best compatibility if it defines an output.columns property and emits
a 'resize' event on the output if or when the columns ever change
(process.stdout does this automatically when it is a TTY).
Parameters
Section titled “Parameters”ReadableStream
output?
Section titled “output?”WritableStream
completer?
Section titled “completer?”Completer
terminal?
Section titled “terminal?”boolean
Returns
Section titled “Returns”v17.0.0
Call Signature
Section titled “Call Signature”createInterface(
options):ReadLineInterface
Defined in: _worktrees/docs-release/gaunt-sloth/node_modules/.pnpm/@types+node@26.1.2/node_modules/@types/node/readline/promises.d.ts:154
The readlinePromises.createInterface() method creates a new readlinePromises.Interface instance.
import readlinePromises from 'node:readline/promises';const rl = readlinePromises.createInterface({ input: process.stdin, output: process.stdout,});Once the readlinePromises.Interface instance is created, the most common case
is to listen for the 'line' event:
rl.on('line', (line) => { console.log(`Received: ${line}`);});If terminal is true for this instance then the output stream will get
the best compatibility if it defines an output.columns property and emits
a 'resize' event on the output if or when the columns ever change
(process.stdout does this automatically when it is a TTY).
Parameters
Section titled “Parameters”options
Section titled “options”ReadLineOptions
Returns
Section titled “Returns”v17.0.0