Node.js · Module
node:readline
Node.js readline reads a Readable stream one line at a time. It supports interactive prompts, line events, command history, completion, and promise-based or callback APIs.
Last updated
- Since
- v0.10.0
Syntax
readline.createInterface(options)
readlinePromises.createInterface(options)In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
readline.InterfacereadlinePromises.Interfacereadline.createInterface()readlinePromises.createInterface()rl.question()'line' event'close' eventreadline.emitKeypressEvents()