-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.js
63 lines (55 loc) · 1.92 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/usr/bin/env node
const figlet = require('figlet');
const chalk = require("chalk");
const clear = require('clear');
const inquirer = require('inquirer');
const resumeData = require('./resumeData.json');
let blueColor = chalk.blue.bold;
let redColor = chalk.red.bold;
var prompts = {
type: "list",
name: "option",
message: "What would you like to know about me?",
choices: [...Object.keys(resumeData), "Exit"]
};
(function(){
clear();
console.log(
chalk.cyan.bold(
figlet.textSync(' Sunny Setia ',{
horizontalLayout:'full',
}))
);
console.log("\n")
console.log(chalk.red.bold(" \u{1F916} Full Stack Developer") + " \n\n + Believes in possibilities and always trying to look at the positive, brighter side of the story. \n\n • Have good experience in fullstack web development. \n • Have e2e knowledge of IoT applications including edge computing and cloud.")
console.log("\n")
menu();
})();
function menu(){
inquirer.prompt(prompts).then(choice=>{
let selectedOption = choice.option;
if(selectedOption==="Exit"){
console.log(redColor("\nThank you for showing interest. Have a great day !"));
return;
}
console.log('\n====================================\n');
resumeData[`${selectedOption}`].forEach(data => {
console.log("\u{1F538} "+ blueColor(data));
});
console.log('\n====================================\n');
inquirer.prompt({
type: "list",
name: "option",
message: "Go back or Exit?",
choices: ["Back", "Exit"]
})
.then(choice => {
if (choice.option == "Back") {
menu();
} else {
console.log(redColor("\nThank you for showing interest. Have a great day !"));
return;
}
});
})
}