Node.js module
readline/promises
The 'node:readline/promises' module offers Promise-based variants of the readline API, allowing async/await usage for methods such as rl.question.
This simplifies writing asynchronous command-line interactions with clearer control flow.
Functions 1
- promises.createInterface()
The
readlinePromises.createInterface()method creates a newreadlinePromises.Interfaceinstance.
Classes 2
- class promises.Interface
Instances of the
readlinePromises.Interfaceclass are constructed using thereadlinePromises.createInterface()method. - class promises.Readline