Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const readline = require('readline');
- const rl = readline.createInterface({
- input: process.stdin,
- output: process.stdout
- });
- function Demander(question) {
- return new Promise((resolve, reject) => {
- rl.question(question, (response) => {
- resolve(response);
- })
- })
- }
- async function main() {
- let response = await Demander("A ?");
- console.log(response);
- rl.close();
- }
- main();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement