console-read-write
Read from and write to the Node.js console. A simple async/await
interface for the readline
module
Install
npm i --save console-read-write
Usage
const io = ; { // Simple readline scenario io; io; // Simple question scenario io; // Since you are not blocking the IO, you can go wild with while loops! let saidHi = false; while !saidHi io; saidHi = await io === 'hi'; io;} ;// I will echo whatever you write!// > ok// ok// Who are you? someone// hello someone!// Say hi or I will repeat...// > no// Say hi or I will repeat...// > ok// Say hi or I will repeat...// > hi// Thanks! Now you may leave.