Skip to main content
createInterface - node__readline--promises.d.ts - Node documentation
function createInterface

Usage in Deno

```typescript import { createInterface } from "node:node__readline--promises.d.ts"; ```
createInterface(
input: ReadableStream,
output?: WritableStream,
completer?: Completer | AsyncCompleter,
terminal?: boolean,
): Interface
The `readlinePromises.createInterface()` method creates a new `readlinePromises.Interface` instance. ```js 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: ```js 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

input: ReadableStream
optional
output: WritableStream
optional
completer: Completer | AsyncCompleter
optional
terminal: boolean

Return Type

createInterface(options: ReadLineOptions): Interface

Parameters

Return Type