Skip to content

Instantly share code, notes, and snippets.

@inoyakaigor
Last active April 27, 2017 10:36
Show Gist options
  • Save inoyakaigor/49b76675894e2408f63ac16d00ddbe79 to your computer and use it in GitHub Desktop.
Save inoyakaigor/49b76675894e2408f63ac16d00ddbe79 to your computer and use it in GitHub Desktop.
let appId = login = password = phone = ''
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout
})
let asker = (variable, name) => () => rl.question(`Введите ${name}: `, answer => {
variable = answer
rl.close() // ЧТО Я ДОЛЖЕН ЗДЕСЬ НАПИСАТЬ?
})
const askAppId = asker(appId, "app id")
const askLogin = asker(login, "логин")
askLogin()
askAppId()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment