Skip to content

Instantly share code, notes, and snippets.

@ajcrites
Created December 16, 2015 18:18
Show Gist options
  • Save ajcrites/dac45004f11703e4a8fd to your computer and use it in GitHub Desktop.
Save ajcrites/dac45004f11703e4a8fd to your computer and use it in GitHub Desktop.
var Promise = require("bluebird");
var readline = require("mz/readline");
var userId = "blarg";
var rl = readline.createInterface({
input: process.stdin,
output: process.stdout,
});
rl.question("are you sure\nplease enter userId").then(function (answer) {
if (answer === userId) {
return rl.question("danger bay was a good show");
}
else {
console.log("user id is wrong, idiot");
}
}).then(function (answer) {
if ("y" === answer) {
return console.log("dead");
}
console.log("alive");
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment