nazmul 1.0.0 → 1.0.2

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.
Files changed (2) hide show
  1. package/index.js +44 -16
  2. package/package.json +2 -1
package/index.js CHANGED
@@ -1,17 +1,27 @@
1
- #!/usr/bin/env node
1
+ #!/usr/bin/env node
2
2
 
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: `${chalk.white("Fullstack Developer")}`,
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("Web:")} ${data.web}
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 menu
35
- const prompt = await inquirer.prompt([
36
- {
37
- type: "list",
38
- name: "action",
39
- message: "What you want to do?",
40
- choices: ["Send me an email", "Exit"],
41
- },
42
- ]);
43
-
44
- if (prompt.action === "Send me an email") {
45
- console.log(chalk.blue("mailto:your@email.com"));
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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nazmul",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "Nazmul CLI Business Card",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -17,6 +17,7 @@
17
17
  "boxen": "^8.0.1",
18
18
  "chalk": "^5.6.2",
19
19
  "inquirer": "^13.4.1",
20
+ "open": "^11.0.0",
20
21
  "ora": "^9.3.0"
21
22
  }
22
23
  }