Created
December 24, 2019 17:42
-
-
Save wordijp/4fd8e45728e36271e615daf3982c5c4f to your computer and use it in GitHub Desktop.
To enter multi-byte characters with cmd
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
const readline = require('readline'); | |
module.exports = { | |
question: async q => { | |
return new Promise((resolve, reject) => { | |
const rl = readline.createInterface({ | |
input: process.stdin, | |
output: process.stdout, | |
}); | |
rl.question(q, keyword => { | |
resolve(keyword); | |
rl.close(); | |
}); | |
}); | |
}, | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment