Last active
April 26, 2025 12:17
-
-
Save mauroao/6511c31170e34b8761d71a091ceebe7d to your computer and use it in GitHub Desktop.
Revisions
-
mauroao revised this gist
May 22, 2020 . 1 changed file with 4 additions and 5 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,12 +1,11 @@ const readline = require('readline'); const readLineAsync = () => { const rl = readline.createInterface({ input: process.stdin }); return new Promise((resolve) => { rl.prompt(); rl.on('line', (line) => { rl.close(); @@ -17,7 +16,7 @@ const readLineAssync = () => { const run = async () => { console.log('what is your name ? '); const line = await readLineAsync(); console.log(`Your name is ${line}`); }; -
mauroao created this gist
May 22, 2020 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,24 @@ const readline = require('readline'); const readLineAssync = () => { const rl = readline.createInterface({ input: process.stdin, output: process.stdout }); return new Promise((resolve, reject) => { rl.prompt(); rl.on('line', (line) => { rl.close(); resolve(line); }); }); }; const run = async () => { console.log('what is your name ? '); const line = await readLineAssync(); console.log(`Your name is ${line}`); }; run();