Created
October 22, 2019 02:32
-
-
Save YuriFontella/b0fa9c6ca130e020b44569fad9bd64b5 to your computer and use it in GitHub Desktop.
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
| 'use strict' | |
| const readline = require('readline') | |
| module.exports = hint => { | |
| return new Promise((resolve, reject) => { | |
| const rl = readline.createInterface({ | |
| input: process.stdin, | |
| output: process.stdout, | |
| }) | |
| rl.question(hint, input => { | |
| rl.close() | |
| resolve(input) | |
| }) | |
| }).catch(console.log) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment