nazmul 1.0.2 → 1.0.4
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 +48 -49
- package/package.json +2 -1
package/index.js
CHANGED
|
@@ -1,28 +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
|
-
import
|
|
5
|
+
import { select } from "@inquirer/prompts"; // ✅ new API
|
|
6
6
|
import ora from "ora";
|
|
7
7
|
import open from "open";
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
const spinner = ora("Loading Nazmul CLI...").start();
|
|
9
|
+
const run = async () => {
|
|
10
|
+
const spinner = ora("Loading Nazmul CLI...").start();
|
|
11
11
|
|
|
12
|
-
const data = {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
};
|
|
12
|
+
const data = {
|
|
13
|
+
name: chalk.bold.greenBright("Nazmul Hasan Shanto"),
|
|
14
|
+
work: chalk.white("['Fullstack Developer', 'Backend Developer', 'Next.js Developer']"),
|
|
15
|
+
github: chalk.cyan("https://github.com/NazmulHasan18"),
|
|
16
|
+
linkedin: chalk.cyan("https://www.linkedin.com/in/nazmul-hasan-shanto-a67041182/"),
|
|
17
|
+
web: chalk.cyan("https://nazmul-portfolio-next-beryl.vercel.app/"),
|
|
18
|
+
};
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
await new Promise((res) => setTimeout(res, 1200));
|
|
21
|
+
spinner.stop();
|
|
22
|
+
console.clear();
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
const output = `
|
|
24
|
+
const output = `
|
|
26
25
|
${data.name}
|
|
27
26
|
|
|
28
27
|
${chalk.bold("Work:")} ${data.work}
|
|
@@ -32,43 +31,43 @@ ${chalk.bold("LinkedIn:")} ${data.linkedin}
|
|
|
32
31
|
${chalk.bold("Portfolio:")} ${data.web}
|
|
33
32
|
`;
|
|
34
33
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
34
|
+
console.log(
|
|
35
|
+
boxen(output, {
|
|
36
|
+
padding: 1,
|
|
37
|
+
margin: 1,
|
|
38
|
+
borderStyle: "round",
|
|
39
|
+
borderColor: "green",
|
|
40
|
+
}),
|
|
41
|
+
);
|
|
43
42
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
{
|
|
48
|
-
type: "list",
|
|
49
|
-
name: "action",
|
|
43
|
+
while (true) {
|
|
44
|
+
const action = await select({
|
|
45
|
+
// ✅ select() instead of prompt([{type:"list"}])
|
|
50
46
|
message: "What do you want to do?",
|
|
51
|
-
choices: [
|
|
52
|
-
|
|
53
|
-
|
|
47
|
+
choices: [
|
|
48
|
+
{ name: "🚀 Open GitHub", value: "github" },
|
|
49
|
+
{ name: "🌐 Open Portfolio", value: "portfolio" },
|
|
50
|
+
{ name: "💼 Open LinkedIn", value: "linkedin" },
|
|
51
|
+
{ name: "📧 Send Email", value: "email" },
|
|
52
|
+
{ name: "❌ Exit", value: "exit" },
|
|
53
|
+
],
|
|
54
|
+
});
|
|
54
55
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
56
|
+
const actions = {
|
|
57
|
+
github: () => open("https://github.com/NazmulHasan18"),
|
|
58
|
+
portfolio: () => open("https://nazmul-portfolio-next-beryl.vercel.app/"),
|
|
59
|
+
linkedin: () => open("https://www.linkedin.com/in/nazmul-hasan-shanto-a67041182/"),
|
|
60
|
+
email: () => open("mailto:nazmulhasanshanto13@email.com"),
|
|
61
|
+
};
|
|
59
62
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
63
|
+
if (action === "exit") {
|
|
64
|
+
console.log(chalk.yellow("Goodbye 👋"));
|
|
65
|
+
process.exit(0);
|
|
66
|
+
}
|
|
64
67
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
await open("https://nazmul-portfolio-next-beryl.vercel.app/");
|
|
68
|
+
console.log(chalk.green("Opening..."));
|
|
69
|
+
await actions[action]?.();
|
|
68
70
|
}
|
|
71
|
+
};
|
|
69
72
|
|
|
70
|
-
|
|
71
|
-
console.log(chalk.blue("Opening Email..."));
|
|
72
|
-
await open("mailto:nazmulhasanshanto13@email.com");
|
|
73
|
-
}
|
|
74
|
-
}
|
|
73
|
+
run();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nazmul",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"description": "Nazmul CLI Business Card",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
"author": "",
|
|
15
15
|
"license": "ISC",
|
|
16
16
|
"dependencies": {
|
|
17
|
+
"@inquirer/prompts": "^8.4.1",
|
|
17
18
|
"boxen": "^8.0.1",
|
|
18
19
|
"chalk": "^5.6.2",
|
|
19
20
|
"inquirer": "^13.4.1",
|