parthesh 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.
Files changed (2) hide show
  1. package/index.js +93 -1
  2. package/package.json +10 -2
package/index.js CHANGED
@@ -1,3 +1,95 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- console.log("Hello, this will be my contact card in the future!");
3
+ const boxen = require("boxen");
4
+ const chalk = require("chalk");
5
+ const clear = require("clear");
6
+ const inquirer = require("inquirer");
7
+ const fetch = require("cross-fetch");
8
+ const open = require("open");
9
+
10
+ clear();
11
+
12
+ const data = {
13
+ name: chalk.bold(" Parthesh Purohit"),
14
+ twitter: chalk.gray("https://x.com/") + chalk.bold.blue("parthesh28"),
15
+ github: chalk.gray("https://github.com/") + chalk.bold.blue("parthesh28"),
16
+ linkedin: chalk.gray("https://linkedin.com/in/") + chalk.bold.blue("partheshpurohit"),
17
+
18
+ labelTwitter: chalk.white.bold("X:"),
19
+ labelGitHub: chalk.white.bold("GitHub:"),
20
+ labelLinkedIn: chalk.white.bold("LinkedIn:"),
21
+ };
22
+
23
+ console.log(
24
+ boxen(
25
+ [
26
+ `${data.name}`,
27
+ ``,
28
+ `${data.labelTwitter} ${data.twitter}`,
29
+ `${data.labelGitHub} ${data.github}`,
30
+ `${data.labelLinkedIn} ${data.linkedin}`,
31
+ ].join("\n"),
32
+ {
33
+ margin: 1,
34
+ padding: 1,
35
+ float: "center",
36
+ borderStyle: "double",
37
+ borderColor: "white",
38
+ }
39
+ )
40
+ );
41
+
42
+ const prompt = inquirer.createPromptModule();
43
+
44
+ const questions = [
45
+ {
46
+ type: "list",
47
+ name: "action",
48
+ message: "What would you like to do?",
49
+ choices: [
50
+ {
51
+ name: `Send ${chalk.bold("message on")} ${chalk.bold.cyan("Telegram")}?`,
52
+ value: async () => {
53
+ let { message } = await inquirer.prompt([
54
+ {
55
+ name: "message",
56
+ message: "Type a message:",
57
+ },
58
+ ]);
59
+ if (!message) return console.log("- Message empty, couldn't send!");
60
+ let response = await fetch(
61
+ "https://npx.parthesh.workers.dev/sendMessage",
62
+ {
63
+ method: "POST",
64
+ headers: { "content-type": "application/json" },
65
+ body: JSON.stringify({ message }),
66
+ }
67
+ );
68
+ console.log(await response.text())
69
+ },
70
+ },
71
+ {
72
+ name: `Send me an ${chalk.green.bold("email")}?`,
73
+ value: async () => {
74
+ await open("mailto:partheshpurohit28@gmail.com");
75
+ console.log("- Done, see you soon at inbox!");
76
+ },
77
+ },
78
+ {
79
+ name: `Download my ${chalk.magentaBright.bold("Resume")}?`,
80
+ value: async () => {
81
+ await open("https://npx.parthesh.workers.dev/files/cv.pdf");
82
+ console.log("- Resume opened in browser!");
83
+ },
84
+ },
85
+ {
86
+ name: "Quit!",
87
+ value: () => {
88
+ console.log("- Thank you for visiting, good bye!");
89
+ },
90
+ },
91
+ ],
92
+ },
93
+ ];
94
+
95
+ prompt(questions).then((answer) => answer.action());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "parthesh",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "My custom NPX card to contact me from the CLI",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -10,5 +10,13 @@
10
10
  "test": "node ."
11
11
  },
12
12
  "author": "Parthesh Purohit <partheshpurohit28@gmail.com>",
13
- "license": "ISC"
13
+ "license": "ISC",
14
+ "dependencies": {
15
+ "boxen": "^4.2.0",
16
+ "chalk": "^4.1.0",
17
+ "clear": "^0.1.0",
18
+ "cross-fetch": "^4.0.0",
19
+ "inquirer": "^7.3.2",
20
+ "open": "^7.0.4"
21
+ }
14
22
  }