-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
98 lines (88 loc) · 2.48 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
#!/usr/bin/env node
"use strict";
import terminalImage from "terminal-image";
import boxen from "boxen";
import chalk from "chalk";
import inquirer from "inquirer";
import clear from "clear";
import open from "open";
clear();
const colors = {
primary: "#0386c6",
};
const data = {
name: "Bouazza Ayyoub",
whoIAm:
"Excited to Build Software Products and Help Others Learn Computer Science.",
linkedIn: "https://www.linkedin.com/in/bouazza-ayyoub",
twitter: "https://twitter.com/AyyoubBouazza",
website: "https://www.abouazza.com",
github: "https://github.com/bouazzaayyoub",
medium: "https://medium.com/@bouazzaayyoub",
whatIamDoing:
"I will help you build software products and learn computer science.",
};
// Build the card
const me = boxen(
[
`${chalk.hex(colors.primary).bold(data.name)}`,
``,
`${chalk.white.bold("Software Engineer")}`,
`${data.whoIAm}`,
``,
`${chalk.hex(colors.primary).bold("Contact:")}`,
`${chalk.white.bold("LinkedIn:")} ${chalk.underline(data.linkedIn)}`,
`${chalk.white.bold("Medium:")} ${chalk.underline(data.medium)}`,
`${chalk.white.bold("Github:")} ${chalk.underline(data.github)}`,
`${chalk.white.bold("Twitter:")} ${chalk.underline(data.twitter)}`,
`${chalk.white.bold("Website:")} ${chalk.underline(data.website)}`,
``,
`${chalk.hex(colors.primary).bold("About me:")}`,
`${chalk.italic(data.whatIamDoing)}`,
``,
`${chalk.italic("Let's talk")} ${chalk.hex(colors.primary)(":)")}`,
].join("\n"),
{
margin: 1,
float: "center",
padding: 2,
borderStyle: "round",
borderColor: colors.primary,
}
);
// Print the card
console.log(me);
// Optional tip to help users use the links
const tip = [
`Tip: Try ${chalk.cyanBright.bold("cmd/ctrl + click")} on the links above`,
"",
].join("\n");
// Show the tip
console.log(tip);
// Ask the Inquirer questions.
const prompt = inquirer.createPromptModule();
// Questions after the card
const questions = [
{
type: "list",
name: "action",
message: "Do you want to build a software product?",
choices: [
{
name: `Send me an ${chalk.green.bold("email")}?`,
value: () => {
open(data.website).then(() => {
console.log("\nSee you soon.\n");
});
},
},
{
name: "Nice to meet you",
value: () => {
console.log("Nice to meet you too!\n");
},
},
],
},
];
prompt(questions).then((answer) => answer.action());