rl.pause()
pause
methog is used to pause the input stream, you can resume the stream by calling
resume() method.
/* Import readline module */ var readline = require('readline'); /* * create a new readline.Interface instance that reads data from standard input * and write data to standard output */ var rl = readline.createInterface({ input: process.stdin, output: process.stdout }); rl.on('pause', () => { console.log("Pause event is received"); }); rl.question("Enter some thing to pause the readline interface instance.", () => { rl.pause(); });
Output
Enter
some thing to pause the readline interface instance.Hello
Pause
event is received
No comments:
Post a Comment