ritik 0.0.12 → 0.0.13
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/dist/index.js +14 -116
- package/package.json +7 -2
package/dist/index.js
CHANGED
|
@@ -1,117 +1,15 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import axios from
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
instagram: chalk.hex("#fb3958"),
|
|
17
|
-
website: chalk.hex("#f1c40f"),
|
|
18
|
-
email: chalk.hex("#f39c12"),
|
|
19
|
-
npx: chalk.hex("#cb3837")
|
|
20
|
-
};
|
|
21
|
-
const getBanner = (type, label, value) => {
|
|
22
|
-
var _a, _b, _c;
|
|
23
|
-
return (_c = (_b = (_a = bannerColor[type]) == null ? void 0 : _a.dim) == null ? void 0 : _b.bgWhite) == null ? void 0 : _c.inverse(`${label.padStart(leftPad, " ")}: ${value.padEnd(rightPad, " ")}`);
|
|
24
|
-
};
|
|
25
|
-
const startCase = (string) => {
|
|
26
|
-
return string.charAt(0).toUpperCase() + string.slice(1);
|
|
27
|
-
};
|
|
28
|
-
const padCenter = (string, char = " ") => {
|
|
29
|
-
return string.padStart(string.length + Math.floor((totalPad - string.length) / 2), char).padEnd(totalPad, char);
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
const tip = [`Tip: Try ${chalk.cyanBright.bold("cmd/ctrl + click")} on the links above`, null].join("\n");
|
|
33
|
-
const footer = [
|
|
34
|
-
"I am actively seeking new opportunities and welcome any inquiries",
|
|
35
|
-
"Please feel free to contact me for questions or casual greetings",
|
|
36
|
-
"I will make every effort to respond promptly",
|
|
37
|
-
"My inbox remains open for your correspondence."
|
|
38
|
-
];
|
|
39
|
-
function DrawCard(profile) {
|
|
40
|
-
const fName = profile.personal.displayName.split(" ")[0];
|
|
41
|
-
const website = `https://${profile.personal.displayEmail.replace(/.*@/, "")}`;
|
|
42
|
-
const CardData = [
|
|
43
|
-
null,
|
|
44
|
-
chalk.bold.green(padCenter(profile.personal.displayName)),
|
|
45
|
-
chalk.blackBright(padCenter(profile.personal.currentRole)),
|
|
46
|
-
null
|
|
47
|
-
];
|
|
48
|
-
profile.socialHandles.forEach((social) => {
|
|
49
|
-
CardData.push(getBanner(social.platform, startCase(social.platform), `${social.url}/${social.handle}`));
|
|
50
|
-
});
|
|
51
|
-
CardData.push(getBanner("website", "Portfolio", website));
|
|
52
|
-
CardData.push(getBanner("npx", "Npx", `npx ${fName.toLowerCase()}`));
|
|
53
|
-
CardData.push(null);
|
|
54
|
-
footer.forEach((line) => {
|
|
55
|
-
CardData.push(chalk.italic.whiteBright(padCenter(line)));
|
|
56
|
-
});
|
|
57
|
-
CardData.push(null);
|
|
58
|
-
const Card = boxen(CardData.join("\n"), {
|
|
59
|
-
margin: 1,
|
|
60
|
-
float: "center",
|
|
61
|
-
borderStyle: "single",
|
|
62
|
-
borderColor: "green"
|
|
63
|
-
});
|
|
64
|
-
console.log(Card);
|
|
65
|
-
console.log(tip);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
const choices = [
|
|
69
|
-
{
|
|
70
|
-
name: `Send me an ${chalk.green.bold("email")}?`,
|
|
71
|
-
value: "email" /* EMAIL */
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
name: `Checkout my ${chalk.magentaBright.bold("Resume")}?`,
|
|
75
|
-
value: "resume" /* RESUME */
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
name: `Schedule a ${chalk.redBright.bold("Meeting")}?`,
|
|
79
|
-
value: "meeting" /* MEETING */
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
name: "Exit.",
|
|
83
|
-
value: "quit" /* QUIT */
|
|
84
|
-
}
|
|
85
|
-
];
|
|
86
|
-
function Prompt(profile) {
|
|
87
|
-
const actions = {
|
|
88
|
-
["email" /* EMAIL */]: () => {
|
|
89
|
-
var _a, _b;
|
|
90
|
-
open(`mailto:${(_a = profile == null ? void 0 : profile.personal) == null ? void 0 : _a.displayEmail}?subject=Hi%20${(_b = profile == null ? void 0 : profile.personal) == null ? void 0 : _b.displayName.split(" ")[0]}!`);
|
|
91
|
-
console.log("\nDone, Catch you in your inbox soon!\n");
|
|
92
|
-
},
|
|
93
|
-
["resume" /* RESUME */]: () => {
|
|
94
|
-
open("https://go.ritik.me/resume");
|
|
95
|
-
console.log("\nYour interest is greatly appreciated!\n");
|
|
96
|
-
},
|
|
97
|
-
["meeting" /* MEETING */]: () => {
|
|
98
|
-
open("https://calendly.com/itzzritik/hello");
|
|
99
|
-
console.log("\nLooking forward to our meeting! See you there.\n");
|
|
100
|
-
},
|
|
101
|
-
["quit" /* QUIT */]: () => {
|
|
102
|
-
console.log("Hasta la vista.\n");
|
|
103
|
-
}
|
|
104
|
-
};
|
|
105
|
-
select({
|
|
106
|
-
message: "Choose an Action",
|
|
107
|
-
choices
|
|
108
|
-
}).then((answer) => actions[answer]());
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
const run = async () => {
|
|
112
|
-
console.clear();
|
|
113
|
-
const profile = await axios.get("https://raw.githubusercontent.com/itzzritik/ItzzRitik/main/profile/profile.json");
|
|
114
|
-
DrawCard(profile.data);
|
|
115
|
-
Prompt(profile.data);
|
|
116
|
-
};
|
|
117
|
-
run();
|
|
2
|
+
import h from"axios";import u from"boxen";import o from"chalk";import{select as g}from"@inquirer/prompts";import l from"open";const c=22,p=52,m=c+p+2,f={facebook:o.hex("#3b5998"),twitter:o.hex("#1DA1F2"),linkedin:o.hex("#0077B5"),github:o.hex("#666666"),instagram:o.hex("#fb3958"),website:o.hex("#f1c40f"),email:o.hex("#f39c12"),npx:o.hex("#cb3837")},r=(e,t,n)=>f[e]?.dim?.bgWhite?.inverse(`${t.padStart(c," ")}: ${n.padEnd(p," ")}`),b=e=>e.charAt(0).toUpperCase()+e.slice(1),s=(e,t=" ")=>e.padStart(e.length+Math.floor((m-e.length)/2),t).padEnd(m,t),y=[`Tip: Try ${o.cyanBright.bold("cmd/ctrl + click")} on the links above`,null].join(`
|
|
3
|
+
`),w=["I am actively seeking new opportunities and welcome any inquiries","Please feel free to contact me for questions or casual greetings","I will make every effort to respond promptly","My inbox remains open for your correspondence."];function x(e){const t=e.personal.displayName.split(" ")[0],n=`https://${e.personal.displayEmail.replace(/.*@/,"")}`,i=[null,o.bold.green(s(e.personal.displayName)),o.blackBright(s(e.personal.currentRole)),null];e.socialHandles.forEach(a=>{i.push(r(a.platform,b(a.platform),`${a.url}/${a.handle}`))}),i.push(r("website","Portfolio",n)),i.push(r("npx","Npx",`npx ${t.toLowerCase()}`)),i.push(null),w.forEach(a=>{i.push(o.italic.whiteBright(s(a)))}),i.push(null);const d=u(i.join(`
|
|
4
|
+
`),{margin:1,float:"center",borderStyle:"single",borderColor:"green"});console.log(d),console.log(y)}var $=(e=>(e.EMAIL="email",e.RESUME="resume",e.MEETING="meeting",e.EXIT="exit",e))($||{});const k=[{name:`Send me an ${o.green.bold("email")}?`,value:"email",description:o.white.dim.bold(`
|
|
5
|
+
I will get back to you as soon as possible.`)},{name:`Checkout my ${o.magentaBright.bold("Resume")}?`,value:"resume",description:o.white.dim.bold(`
|
|
6
|
+
I am actively seeking new opportunities and welcome any inquiries.`)},{name:`Schedule a ${o.redBright.bold("Meeting")}?`,value:"meeting",description:o.white.dim.bold(`
|
|
7
|
+
I will make every effort to respond promptly.`)},{name:"Exit.",value:"exit",description:o.white.dim.bold(`
|
|
8
|
+
Hasta la vista.`)}];function v(e){const t={email:()=>{l(`mailto:${e?.personal?.displayEmail}?subject=Hi%20${e?.personal?.displayName.split(" ")[0]}!`),console.log(`
|
|
9
|
+
Done, Catch you in your inbox soon!
|
|
10
|
+
`)},resume:()=>{l("https://go.ritik.me/resume"),console.log(`
|
|
11
|
+
Your interest is greatly appreciated!
|
|
12
|
+
`)},meeting:()=>{l("https://calendly.com/itzzritik/hello"),console.log(`
|
|
13
|
+
Looking forward to our meeting! See you there.
|
|
14
|
+
`)},exit:()=>{console.log(`Hasta la vista.
|
|
15
|
+
`)}};g({message:"Choose an Action",choices:k}).then(n=>t[n]())}const E=async()=>{console.clear();const e=await h.get("https://raw.githubusercontent.com/itzzritik/ItzzRitik/main/profile/profile.json");x(e.data),v(e.data)};E();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ritik",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.13",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "CLI Portfolio",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"scripts": {
|
|
14
14
|
"build": "rollup -c",
|
|
15
15
|
"start": "rollup -c && node dist/index.js",
|
|
16
|
-
"dev": "ts-node
|
|
16
|
+
"dev": "ts-node-esm src/index.ts"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"@inquirer/prompts": "^3.0.0",
|
|
@@ -24,7 +24,12 @@
|
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@types/node": "^20.4.2",
|
|
27
|
+
"@typescript-eslint/eslint-plugin": "^6.1.0",
|
|
28
|
+
"@typescript-eslint/parser": "^6.1.0",
|
|
27
29
|
"esbuild": "^0.18.15",
|
|
30
|
+
"eslint": "^8.45.0",
|
|
31
|
+
"eslint-import-resolver-typescript": "^3.5.5",
|
|
32
|
+
"eslint-plugin-import": "^2.27.5",
|
|
28
33
|
"rollup": "^3.26.3",
|
|
29
34
|
"rollup-plugin-esbuild": "^5.0.0",
|
|
30
35
|
"ts-node": "^10.9.1",
|