Skip to content

Instantly share code, notes, and snippets.

@JoeDoyle23
Created December 15, 2019 23:08
Show Gist options
  • Save JoeDoyle23/15e073dfc1d599337806c951f0088c6e to your computer and use it in GitHub Desktop.
Save JoeDoyle23/15e073dfc1d599337806c951f0088c6e to your computer and use it in GitHub Desktop.
Readline
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