-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
130 lines (114 loc) · 4.48 KB
/
index.js
File metadata and controls
130 lines (114 loc) · 4.48 KB
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
#!/usr/bin/env node
import chalk from "chalk";
import boxen from "boxen";
// ASCII Logo
const asciiLogo = `
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@#++++++++++#@@@@@@@@@@@
@@@@@@@@@@@@@@@@@*. .-@@@@@@@@@
@@@@@@@@@@@@@@@@@*. .... *@@@@@@@@
@@@@@@@@@@@@@@#@@*. .%@@% =@@@@@@@@
@@@@@@@@@@@@@:=@@*. .%@@% =@@@@@@@@
@@@@@@@@@@@%:.=@@*. .%@@% =@@@@@@@@
@@@@@@@@@@@: .=@@*. .%@@% =@@@@@@@@
@@@@@@@@@@. .%@@*. .%@@@====*@@@@@@@@
@@@@@@@@@+..:@@@@*. .%@@@@@@@@@@@@@@@@
@@@@@@@@@+.:%@@@@*. .%@-.....=@@@@@@@@
@@@@@@@@@+.@@#=@@*. .%%: =@@@@@@@@
@@@@@@@@@#@@+.=@@*. .%%-- =@@@@@@@@
@@@@@@@@@@@*..=@@*. .%@@% =@@@@@@@@
@@@@@@@@@@+. .=@@*. .%@@% =@@@@@@@@
@@@@@@@@@+. .=@@*. .%@@% =@@@@@@@@
@@@@@@@@@+. .=@@*. .%@@% =@@@@@@@@
@@@@@@@@@+. .=@@*. .%@@% =@@@@@@@@
@@@@@@@@@+. .=@@+. .*##* =@@@@@@@@
@@@@@@@@@#. .#@@@@@@@@
@@@@@@@@@@#. .+@@@@@@@@@
@@@@@@@@@@@@@%#####@@@%%%%%%@@@@@@@@@@@@
`;
const details = {
name: chalk.cyan("Unmesh Ghosh"),
occupation: chalk.magenta(" I am a FullStack Developer & CP"),
website: chalk.blue(`https://unmesh.vercel.app/`),
github: chalk.green(`https://github.com/Unmesh100`),
twitter: chalk.cyan(`https://x.com/Unmesh_Ghosh`),
email: chalk.red(` unmesh.280@gmail.com`),
linkedin: chalk.yellow(' https://www.linkedin.com/in/unmesh-ghosh/'),
languages: {
JavaScript: { icon: "🟨", color: chalk.yellow },
Cpp: { icon: "🟦", color: chalk.blueBright },
Python: { icon: "🐍", color: chalk.green },
Java: { icon: "🔵", color: chalk.blue },
Rust: { icon: "🦀", color: chalk.red },
},
frameworks: {
NextJs: { icon: "🌐 ", color: chalk.yellow },
ExpressJs: { icon: "🚂", color: chalk.blueBright },
TailwindCss: { icon: "🍃", color: chalk.green },
ReactJs: { icon: "🌐", color: chalk.blue },
},
others: {
Docker: { icon: "🐳", color: chalk.blue },
mongodb: { icon: "🍃", color: chalk.green },
SQL: { icon: "🐘", color: chalk.blue },
Git: { icon: "🐙", color: chalk.blue },
Linux: { icon: "🐧", color: chalk.blue },
}
};
const languagesArray = Object.entries(details.languages);
const frameworksArray = Object.entries(details.frameworks);
const othersArray = Object.entries(details.others);
const languagesRows = [];
const frameworksRows = [];
const othersRows = [];
for (let i = 0; i < languagesArray.length; i += 4) {
const slicedLanguages = languagesArray.slice(i, i + 4);
const row = slicedLanguages
.map(([lang, { icon, color }]) => `${color(`${icon} ${lang}`)}`)
.join(" ");
languagesRows.push(row);
}
for (let i = 0; i < frameworksArray.length; i += 4) {
const slicedFrameworks = frameworksArray.slice(i, i + 4);
const row = slicedFrameworks
.map(([lang, { icon, color }]) => `${color(`${icon} ${lang}`)}`)
.join(" ");
frameworksRows.push(row);
}
for (let i = 0; i < othersArray.length; i += 4) {
const slicedOthers = othersArray.slice(i, i + 4);
const row = slicedOthers
.map(([lang, { icon, color }]) => `${color(`${icon} ${lang}`)}`)
.join(" ");
othersRows.push(row);
}
const info = [
`${chalk.bold("🦷 Name:")}${details.name}`,
`${chalk.bold("💡 About:")} ${details.occupation}`,
`${chalk.bold("🌐 Website:")} ${details.website}`,
`${chalk.bold("🐙 GitHub:")} ${details.github}`,
`${chalk.bold("🐦 Twitter:")} ${details.twitter}`,
`${chalk.bold("📧 Email:")} ${details.email}`,
`${chalk.bold("🌐 Linkedin")} ${details.linkedin}`,
`${chalk.bold("💻 Languages:")}`,
...languagesRows,
`${chalk.bold("🔧 Frameworks:")}`,
...frameworksRows,
`${chalk.bold("🔧 Others:")}`,
...othersRows,
];
const asciiLogoLines = asciiLogo.split("\n");
const infoLines = info;
const logoWidth = Math.max(...asciiLogoLines.map((line) => line.length));
const detailsWidth = Math.max(...infoLines.map((line) => line.length));
logoWidth + 4 + detailsWidth;
const outputLines = [];
for (let i = 0; i < Math.max(asciiLogoLines.length, infoLines.length); i++) {
const logoLine = asciiLogoLines[i] || "";
const infoLine = infoLines[i] || "";
const paddedLogoLine = logoLine.padEnd(logoWidth, " ");
outputLines.push(`${paddedLogoLine} ${infoLine}`);
}
const output = outputLines.join("\n");
const message = boxen(output, { padding: 1, margin: 1, borderStyle: "classic" });
console.log(message);