ayushd785
Version:
A personal CLI card displayed when run via npx
81 lines (71 loc) • 2.46 kB
JavaScript
import fs from "fs";
import path from "path";
import { fileURLToPath } from "url";
import chalk from "chalk";
import boxen from "boxen";
// robust __dirname in ESM
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
// read art.txt
const artPath = path.join(__dirname, "art.txt");
let art = "";
try {
art = fs.readFileSync(artPath, "utf8");
} catch (err) {
art = "";
}
// color the art (change hex if you want)
const coloredArt = chalk.hex("#7dd3fc")(art);
// OSC 8 hyperlink helper (works in many modern terminals)
function link(url, text) {
return `\u001b]8;;${url}\u0007${text}\u001b]8;;\u0007`;
}
const info = {
name: chalk.white.bold("AYUSH KUMAR DWIVEDI"),
about: chalk.hex("#c084fc")("Backend Dev • Mern & Go • Distributed Systems"),
website: link(
"https://portfolio-m8g94w62f-ayush-dwivedis-projects-9e14858f.vercel.app/",
chalk.cyan("Ayushd785.dev")
),
github: link(
"https://github.com/Ayushd785",
chalk.cyan("github.com/Ayushd785")
),
twitter: link("https://x.com/AyushKumar0704", chalk.cyan("@Ayushkumar0704")),
email: link("mailto:ayushd785@gmail.com", chalk.red("ayushd785@gmail.com")),
linkedin: link(
"https://www.linkedin.com/in/ayush-kumar-dwivedi-858180143/",
chalk.yellow("linkedin.com/in/ayush-kumar-dwivedi-858180143")
),
languages: `${chalk.yellow("JavaScript")} ${chalk.blue(
"C++"
)} ${chalk.green("Python")} ${chalk.yellow("TypeScript")} ${chalk.blue(
"GoLang"
)} ${chalk.yellow("Java")}`,
techStack:
chalk.magentaBright("💻 Tech Stack:") +
" Node.js | Go | MongoDB | Express.js | AWS | Docker | DSA | GenAI | React | TypeScript | Java | System Design",
};
const lines = [
coloredArt,
"",
`${chalk.magenta("👤 Name:")} ${info.name}`,
`${chalk.magenta("💡 About:")} ${info.about}`,
"",
`${chalk.magenta("🌐 Website:")} ${info.website}`,
`${chalk.magenta("🐙 GitHub:")} ${info.github}`,
`${chalk.magenta("🐦 Twitter:")} ${info.twitter}`,
`${chalk.magenta("📧 Email:")} ${info.email}`,
`${chalk.magenta("🔗 LinkedIn:")} ${info.linkedin}`,
"",
`${chalk.magenta("💻 Languages:")} ${info.languages}`,
`${info.techStack}`,
].join("\n");
const output = boxen(lines, {
padding: 1,
margin: 1,
borderStyle: "round",
borderColor: "cyan",
});
console.log(output);