Advertisement
Guest User

Untitled

a guest
Mar 29th, 2020
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. const readline = require('readline');
  2.  
  3. const rl = readline.createInterface({
  4. input: process.stdin,
  5. output: process.stdout
  6. });
  7.  
  8. function Demander(question) {
  9. return new Promise((resolve, reject) => {
  10. rl.question(question, (response) => {
  11. resolve(response);
  12. })
  13. })
  14. }
  15.  
  16. async function main() {
  17. let response = await Demander("A ?");
  18. console.log(response);
  19. rl.close();
  20. }
  21. main();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement