Skip to content

Instantly share code, notes, and snippets.

@silent-lad
Last active February 27, 2019 08:08
Show Gist options
  • Save silent-lad/6840d600342a5a70a3c35393bb72960b to your computer and use it in GitHub Desktop.
Save silent-lad/6840d600342a5a70a3c35393bb72960b to your computer and use it in GitHub Desktop.
#!/usr/bin/env node
"use strict";
var inquirer = require("inquirer");
var chalk = require("chalk");
var response = chalk.bold.green;
var resume = require("./resume.json");
var resumePrompts = {
type: "list",
name: "resumeOptions",
message: "What do you want to know about me?",
choices: [...Object.keys(resume), "Exit"]
};
function main() {
console.log("Hello,My name is SilentLad and welcome to my resume");
resumeHandler();
}
function resumeHandler() {
inquirer.prompt(resumePrompts).then(answer => {
if (answer.resumeOptions == "Exit") {
return;
}
var option = answer.resumeOptions;
console.log(response("--------------------------------------"));
resume[`${option}`].forEach(info => {
console.log(response("| => " + info));
});
console.log(response("--------------------------------------"));
// console.log(resume[`${option}`]);
inquirer
.prompt({
type: "list",
name: "exitBack",
message: "Go back or Exit?",
choices: ["Back", "Exit"]
})
.then(choice => {
if (choice.choices == "Back") {
resumeHandler();
} else {
return;
}
});
});
}
main();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment