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.
Files changed (2) hide show
  1. package/dist/index.js +117 -10
  2. package/package.json +56 -51
package/dist/index.js CHANGED
@@ -1,10 +1,117 @@
1
- (function(t,o){typeof exports=="object"&&typeof module<"u"?o(require("axios"),require("chalk"),require("boxen"),require("open"),require("@inquirer/prompts")):typeof define=="function"&&define.amd?define(["axios","chalk","boxen","open","@inquirer/prompts"],o):(t=typeof globalThis<"u"?globalThis:t||self,o(t.o$1,t.e,t.p,t.t,t.prompts))})(this,function(t,o,p,s,u){"use strict";const m={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")},l=(e,i,r)=>m[e]?.dim?.bgWhite?.inverse(`${i.padStart(22," ")}: ${r.padEnd(52," ")}`),h=e=>e.charAt(0).toUpperCase()+e.slice(1),c=(e,i=" ")=>e.padStart(e.length+Math.floor((76-e.length)/2),i).padEnd(76,i),d=[`Tip: Try ${o.cyanBright.bold("cmd/ctrl + click")} on the links above`,null].join(`
2
- `),f=["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 g(e){const i=e.personal.displayName.split(" ")[0],r=`https://${e.personal.displayEmail.replace(/.*@/,"")}`,n=[null,o.bold.green(c(e.personal.displayName)),o.blackBright(c(e.personal.currentRole)),null];e.socialHandles.forEach(a=>{n.push(l(a.platform,h(a.platform),`${a.url}/${a.handle}`))}),n.push(l("website","Portfolio",r)),n.push(l("npx","Npx",`npx ${i.toLowerCase()}`)),n.push(null),f.forEach(a=>{n.push(o.italic.whiteBright(c(a)))}),n.push(null);const x=p(n.join(`
3
- `),{margin:1,float:"center",borderStyle:"single",borderColor:"green"});console.log(x),console.log(d)}var y=(e=>(e.EMAIL="email",e.RESUME="resume",e.MEETING="meeting",e.QUIT="quit",e))(y||{});const $=[{name:`Send me an ${o.green.bold("email")}?`,value:"email"},{name:`Checkout my ${o.magentaBright.bold("Resume")}?`,value:"resume"},{name:`Schedule a ${o.redBright.bold("Meeting")}?`,value:"meeting"},{name:"Exit.",value:"quit"}];function b(e){const i={email:()=>{s(`mailto:${e?.personal?.displayEmail}?subject=Hi%20${e?.personal?.displayName.split(" ")[0]}!`),console.log(`
4
- Done, Catch you in your inbox soon!
5
- `)},resume:()=>{s("https://go.ritik.me/resume"),console.log(`
6
- Your interest is greatly appreciated!
7
- `)},meeting:()=>{s("https://calendly.com/itzzritik/hello"),console.log(`
8
- Looking forward to our meeting! See you there.
9
- `)},quit:()=>{console.log(`Hasta la vista.
10
- `)}};u.select({message:"Choose an Action",choices:$}).then(r=>i[r]())}(async()=>{console.clear();const e=await t.get("https://raw.githubusercontent.com/itzzritik/ItzzRitik/main/profile/profile.json");g(e.data),b(e.data)})()});
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
- "name": "ritik",
3
- "version": "0.0.5",
4
- "type": "module",
5
- "description": "CLI Portfolio",
6
- "main": "dist/index.js",
7
- "bin": "dist/index.js",
8
- "scripts": {
9
- "build": "rollup -c",
10
- "start": "rollup -c && node dist/index.js",
11
- "dev": "ts-node --esm src/index.ts"
12
- },
13
- "dependencies": {
14
- "@inquirer/prompts": "^3.0.0",
15
- "axios": "^1.4.0",
16
- "boxen": "^7.1.1",
17
- "chalk": "^5.3.0",
18
- "open": "^9.1.0"
19
- },
20
- "devDependencies": {
21
- "@types/node": "^20.4.2",
22
- "esbuild": "^0.18.15",
23
- "rollup": "^3.26.3",
24
- "rollup-plugin-esbuild": "^5.0.0",
25
- "ts-node": "^10.9.1",
26
- "typescript": "^5.1.6"
27
- },
28
- "publishConfig": {
29
- "access": "public",
30
- "registry": "https://registry.npmjs.org/"
31
- },
32
- "files": [
33
- "dist"
34
- ],
35
- "repository": {
36
- "type": "git",
37
- "url": "git+https://github.com/itzzritik/npx-ritik.git"
38
- },
39
- "keywords": [
40
- "ritik",
41
- "portfolio",
42
- "npx",
43
- "cli"
44
- ],
45
- "author": {
46
- "name": "Ritik Srivastava"
47
- },
48
- "license": "ISC",
49
- "bugs": {
50
- "url": "https://github.com/itzzritik/npx-ritik/issues"
51
- },
52
- "homepage": "https://github.com/itzzritik/npx-ritik#readme"
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
  }