Skip to content

Instantly share code, notes, and snippets.

@wordijp
Created December 24, 2019 17:42
Show Gist options
  • Save wordijp/4fd8e45728e36271e615daf3982c5c4f to your computer and use it in GitHub Desktop.
Save wordijp/4fd8e45728e36271e615daf3982c5c4f to your computer and use it in GitHub Desktop.
To enter multi-byte characters with cmd
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