3 changed files with 21 additions and 1 deletions
Binary file not shown.
@ -0,0 +1,16 @@ |
|||||
|
import rl from 'readline'; |
||||
|
|
||||
|
ask('Enter your username'); |
||||
|
|
||||
|
export default function ask(question) { |
||||
|
const r = rl.createInterface({ |
||||
|
input: process.stdin, |
||||
|
output: process.stdout, |
||||
|
}); |
||||
|
return new Promise(resolve => { |
||||
|
r.question(`${question}: `, answer => { |
||||
|
r.close(); |
||||
|
resolve(answer); |
||||
|
}); |
||||
|
}); |
||||
|
} |
Loading…
Reference in new issue