Created
January 31, 2018 14:53
-
-
Save christian-fei/5873c819326f5204090ca4f895b0d65b to your computer and use it in GitHub Desktop.
This file contains 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
function query(text) { | |
return new Promise((resolve, reject) => { | |
process.stdin.resume() | |
process.stdout.write(text) | |
process.stdin.once('data', data => resolve(data.toString().trim())) | |
process.stdin.once('error', reject) | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment