Skip to content

Instantly share code, notes, and snippets.

@robbyoconnor
Last active May 31, 2018 11:31
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save robbyoconnor/a5c1f514babbb3309099 to your computer and use it in GitHub Desktop.
Save robbyoconnor/a5c1f514babbb3309099 to your computer and use it in GitHub Desktop.
'use strict';
export default function (question) {
var rl = require('readline');
var r = rl.createInterface({
input: process.stdin,
output: process.stdout,
terminal: false
});
return new Promise((resolve, error) => {
r.question(question, answer => {
r.close();
resolve(answer);
});
})
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment