Created
December 15, 2019 23:08
-
-
Save JoeDoyle23/15e073dfc1d599337806c951f0088c6e to your computer and use it in GitHub Desktop.
Readline
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const {promisify} require('util'); | |
const readline = require('readline'); | |
const r = readline.createInterface({ | |
input: process.stdin, | |
output: process.stdout | |
}); | |
const rl = promisify(r.question); | |
const answer = await rl.question('What do you think of Node.js? ') | |
console.log(`Thank you for your valuable feedback: ${answer}`); | |
r.close(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment