ritik 0.0.5 → 0.0.6
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 +117 -10
- package/package.json +56 -51
package/dist/index.js
CHANGED
|
@@ -1,10 +1,117 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var axios = require('axios');
|
|
5
|
+
var chalk = require('chalk');
|
|
6
|
+
var boxen = require('boxen');
|
|
7
|
+
var open = require('open');
|
|
8
|
+
var prompts = require('@inquirer/prompts');
|
|
9
|
+
|
|
10
|
+
const leftPad = 22;
|
|
11
|
+
const rightPad = 52;
|
|
12
|
+
const totalPad = leftPad + rightPad + 2;
|
|
13
|
+
const bannerColor = {
|
|
14
|
+
facebook: chalk.hex("#3b5998"),
|
|
15
|
+
twitter: chalk.hex("#1DA1F2"),
|
|
16
|
+
linkedin: chalk.hex("#0077B5"),
|
|
17
|
+
github: chalk.hex("#666666"),
|
|
18
|
+
instagram: chalk.hex("#fb3958"),
|
|
19
|
+
website: chalk.hex("#f1c40f"),
|
|
20
|
+
email: chalk.hex("#f39c12"),
|
|
21
|
+
npx: chalk.hex("#cb3837")
|
|
22
|
+
};
|
|
23
|
+
const getBanner = (type, label, value) => {
|
|
24
|
+
return bannerColor[type]?.dim?.bgWhite?.inverse(`${label.padStart(leftPad, " ")}: ${value.padEnd(rightPad, " ")}`);
|
|
25
|
+
};
|
|
26
|
+
const startCase = (string) => {
|
|
27
|
+
return string.charAt(0).toUpperCase() + string.slice(1);
|
|
28
|
+
};
|
|
29
|
+
const padCenter = (string, char = " ") => {
|
|
30
|
+
return string.padStart(string.length + Math.floor((totalPad - string.length) / 2), char).padEnd(totalPad, char);
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
const tip = [`Tip: Try ${chalk.cyanBright.bold("cmd/ctrl + click")} on the links above`, null].join("\n");
|
|
34
|
+
const footer = [
|
|
35
|
+
"I am actively seeking new opportunities and welcome any inquiries",
|
|
36
|
+
"Please feel free to contact me for questions or casual greetings",
|
|
37
|
+
"I will make every effort to respond promptly",
|
|
38
|
+
"My inbox remains open for your correspondence."
|
|
39
|
+
];
|
|
40
|
+
function DrawCard(profile) {
|
|
41
|
+
const fName = profile.personal.displayName.split(" ")[0];
|
|
42
|
+
const website = `https://${profile.personal.displayEmail.replace(/.*@/, "")}`;
|
|
43
|
+
const CardData = [
|
|
44
|
+
null,
|
|
45
|
+
chalk.bold.green(padCenter(profile.personal.displayName)),
|
|
46
|
+
chalk.blackBright(padCenter(profile.personal.currentRole)),
|
|
47
|
+
null
|
|
48
|
+
];
|
|
49
|
+
profile.socialHandles.forEach((social) => {
|
|
50
|
+
CardData.push(getBanner(social.platform, startCase(social.platform), `${social.url}/${social.handle}`));
|
|
51
|
+
});
|
|
52
|
+
CardData.push(getBanner("website", "Portfolio", website));
|
|
53
|
+
CardData.push(getBanner("npx", "Npx", `npx ${fName.toLowerCase()}`));
|
|
54
|
+
CardData.push(null);
|
|
55
|
+
footer.forEach((line) => {
|
|
56
|
+
CardData.push(chalk.italic.whiteBright(padCenter(line)));
|
|
57
|
+
});
|
|
58
|
+
CardData.push(null);
|
|
59
|
+
const Card = boxen(CardData.join("\n"), {
|
|
60
|
+
margin: 1,
|
|
61
|
+
float: "center",
|
|
62
|
+
borderStyle: "single",
|
|
63
|
+
borderColor: "green"
|
|
64
|
+
});
|
|
65
|
+
console.log(Card);
|
|
66
|
+
console.log(tip);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
const choices = [
|
|
70
|
+
{
|
|
71
|
+
name: `Send me an ${chalk.green.bold("email")}?`,
|
|
72
|
+
value: "email" /* EMAIL */
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
name: `Checkout my ${chalk.magentaBright.bold("Resume")}?`,
|
|
76
|
+
value: "resume" /* RESUME */
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
name: `Schedule a ${chalk.redBright.bold("Meeting")}?`,
|
|
80
|
+
value: "meeting" /* MEETING */
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
name: "Exit.",
|
|
84
|
+
value: "quit" /* QUIT */
|
|
85
|
+
}
|
|
86
|
+
];
|
|
87
|
+
function Prompt(profile) {
|
|
88
|
+
const actions = {
|
|
89
|
+
["email" /* EMAIL */]: () => {
|
|
90
|
+
open(`mailto:${profile?.personal?.displayEmail}?subject=Hi%20${profile?.personal?.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
|
+
prompts.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();
|
package/package.json
CHANGED
|
@@ -1,53 +1,58 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
2
|
+
"name": "ritik",
|
|
3
|
+
"version": "0.0.6",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "CLI Portfolio",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"bin": {
|
|
8
|
+
"ritik": "dist/index.js"
|
|
9
|
+
},
|
|
10
|
+
"engines": {
|
|
11
|
+
"node": ">=12"
|
|
12
|
+
},
|
|
13
|
+
"scripts": {
|
|
14
|
+
"build": "rollup -c",
|
|
15
|
+
"start": "rollup -c && node dist/index.js",
|
|
16
|
+
"dev": "ts-node --esm src/index.ts"
|
|
17
|
+
},
|
|
18
|
+
"dependencies": {
|
|
19
|
+
"@inquirer/prompts": "^3.0.0",
|
|
20
|
+
"axios": "^1.4.0",
|
|
21
|
+
"boxen": "^7.1.1",
|
|
22
|
+
"chalk": "^5.3.0",
|
|
23
|
+
"open": "^9.1.0"
|
|
24
|
+
},
|
|
25
|
+
"devDependencies": {
|
|
26
|
+
"@types/node": "^20.4.2",
|
|
27
|
+
"esbuild": "^0.18.15",
|
|
28
|
+
"rollup": "^3.26.3",
|
|
29
|
+
"rollup-plugin-esbuild": "^5.0.0",
|
|
30
|
+
"ts-node": "^10.9.1",
|
|
31
|
+
"typescript": "^5.1.6"
|
|
32
|
+
},
|
|
33
|
+
"publishConfig": {
|
|
34
|
+
"access": "public",
|
|
35
|
+
"registry": "https://registry.npmjs.org/"
|
|
36
|
+
},
|
|
37
|
+
"files": [
|
|
38
|
+
"dist"
|
|
39
|
+
],
|
|
40
|
+
"repository": {
|
|
41
|
+
"type": "git",
|
|
42
|
+
"url": "git+https://github.com/itzzritik/npx-ritik.git"
|
|
43
|
+
},
|
|
44
|
+
"keywords": [
|
|
45
|
+
"ritik",
|
|
46
|
+
"portfolio",
|
|
47
|
+
"npx",
|
|
48
|
+
"cli"
|
|
49
|
+
],
|
|
50
|
+
"author": {
|
|
51
|
+
"name": "Ritik Srivastava"
|
|
52
|
+
},
|
|
53
|
+
"license": "ISC",
|
|
54
|
+
"bugs": {
|
|
55
|
+
"url": "https://github.com/itzzritik/npx-ritik/issues"
|
|
56
|
+
},
|
|
57
|
+
"homepage": "https://github.com/itzzritik/npx-ritik#readme"
|
|
53
58
|
}
|