nazmul 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +43 -15
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -3,15 +3,25 @@
|
|
|
3
3
|
import chalk from "chalk";
|
|
4
4
|
import boxen from "boxen";
|
|
5
5
|
import inquirer from "inquirer";
|
|
6
|
+
import ora from "ora";
|
|
7
|
+
import open from "open";
|
|
8
|
+
|
|
9
|
+
// spinner
|
|
10
|
+
const spinner = ora("Loading Nazmul CLI...").start();
|
|
6
11
|
|
|
7
12
|
const data = {
|
|
8
|
-
name: chalk.greenBright("Nazmul Hasan Shanto"),
|
|
9
|
-
work:
|
|
13
|
+
name: chalk.bold.greenBright("Nazmul Hasan Shanto"),
|
|
14
|
+
work: chalk.white("['Fullstack Developer', 'Backend Developer', 'Next.js Developer']"),
|
|
10
15
|
github: chalk.cyan("https://github.com/NazmulHasan18"),
|
|
11
16
|
linkedin: chalk.cyan("https://www.linkedin.com/in/nazmul-hasan-shanto-a67041182/"),
|
|
12
17
|
web: chalk.cyan("https://nazmul-portfolio-next-beryl.vercel.app/"),
|
|
13
18
|
};
|
|
14
19
|
|
|
20
|
+
// delay for better UX
|
|
21
|
+
await new Promise((res) => setTimeout(res, 1500));
|
|
22
|
+
spinner.stop();
|
|
23
|
+
|
|
24
|
+
// box output
|
|
15
25
|
const output = `
|
|
16
26
|
${data.name}
|
|
17
27
|
|
|
@@ -19,7 +29,7 @@ ${chalk.bold("Work:")} ${data.work}
|
|
|
19
29
|
|
|
20
30
|
${chalk.bold("GitHub:")} ${data.github}
|
|
21
31
|
${chalk.bold("LinkedIn:")} ${data.linkedin}
|
|
22
|
-
${chalk.bold("
|
|
32
|
+
${chalk.bold("Portfolio:")} ${data.web}
|
|
23
33
|
`;
|
|
24
34
|
|
|
25
35
|
const box = boxen(output, {
|
|
@@ -31,16 +41,34 @@ const box = boxen(output, {
|
|
|
31
41
|
|
|
32
42
|
console.log(box);
|
|
33
43
|
|
|
34
|
-
// interactive
|
|
35
|
-
|
|
36
|
-
{
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
// 🔁 interactive loop
|
|
45
|
+
while (true) {
|
|
46
|
+
const { action } = await inquirer.prompt([
|
|
47
|
+
{
|
|
48
|
+
type: "list",
|
|
49
|
+
name: "action",
|
|
50
|
+
message: "What do you want to do?",
|
|
51
|
+
choices: ["🚀 Open GitHub", "🌐 Open Portfolio", "📧 Send Email", "❌ Exit"],
|
|
52
|
+
},
|
|
53
|
+
]);
|
|
54
|
+
|
|
55
|
+
if (action === "❌ Exit") {
|
|
56
|
+
console.log(chalk.yellow("Goodbye 👋"));
|
|
57
|
+
process.exit(0);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
if (action === "🚀 Open GitHub") {
|
|
61
|
+
console.log(chalk.green("Opening GitHub..."));
|
|
62
|
+
await open("https://github.com/NazmulHasan18");
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
if (action === "🌐 Open Portfolio") {
|
|
66
|
+
console.log(chalk.green("Opening Portfolio..."));
|
|
67
|
+
await open("https://nazmul-portfolio-next-beryl.vercel.app/");
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
if (action === "📧 Send Email") {
|
|
71
|
+
console.log(chalk.blue("Opening Email..."));
|
|
72
|
+
await open("mailto:nazmulhasanshanto13@email.com");
|
|
73
|
+
}
|
|
46
74
|
}
|