-
-
Save ajcrites/4e310ec49c2cec1a1551 to your computer and use it in GitHub Desktop.
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 characters
const readline = require("mz/readline"); | |
const co = require("co"); | |
const userId = "blarg"; | |
co(function* () { | |
let rl = readline.createInterface({ | |
input: process.stdin, | |
output: process.stdout, | |
}); | |
let answer = yield rl.question(`are you sure\nplease enter userId`); | |
if (answer === userId) { | |
let answer = yield rl.question(`danger bay was a good show`); | |
if ("y" === answer) { | |
return console.log("dead"); | |
} | |
console.log("alive"); | |
} | |
else { | |
console.log("user id is wrong"); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment