workwithrana 0.0.1 → 0.0.3

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 (3) hide show
  1. package/README.md +18 -0
  2. package/index.js +161 -49
  3. package/package.json +23 -6
package/README.md ADDED
@@ -0,0 +1,18 @@
1
+ # workwithrana
2
+
3
+ A short terminal profile for Rana Jahanzaib, with selected public engineering projects and contact links.
4
+
5
+ ```sh
6
+ npx workwithrana
7
+ ```
8
+
9
+ The command prints a framed profile, three project links, and ways to get in touch. It adapts to narrow terminals, uses color when supported, and honors `NO_COLOR`. It also supports `--help` and `--version`. It has no runtime dependencies or network calls.
10
+
11
+ ## Development
12
+
13
+ ```sh
14
+ npm test
15
+ npm pack --dry-run
16
+ ```
17
+
18
+ Project details and contact information should be reviewed against [workwithrana.com](https://workwithrana.com/) before each release.
package/index.js CHANGED
@@ -1,53 +1,165 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- import boxen from "boxen";
4
- import chalk from "chalk";
5
-
6
- // Resume content
7
- const data = {
8
- name: chalk.bold.green("Rana Jahanzaib"),
9
- handle: chalk.white("@workwithrana"),
10
- work: chalk.white("Full Stack Engineer"),
11
- bio: chalk.gray(
12
- "With over 8 years of industry experience and 20+ Certifications from Google, Meta, AWS, Intel and Kaggle, I've a proven track record of delivering exceptional work."
13
- ),
14
- upwork: chalk.gray("https://upwork.com/fl/") + chalk.cyan("rana"),
15
- github: chalk.gray("https://github.com/") + chalk.cyan("ranajahanzaib"),
16
- linkedin: chalk.gray("https://linkedin.com/in/") + chalk.cyan("workwithrana"),
17
- website: chalk.cyan("https://workwithrana.com"),
18
- email: chalk.white("work@ewithrana.com"),
19
- skills: chalk.white("Rust, Go, Python, React & iOS"),
20
- npx: chalk.green("npx rana"),
21
- labelWork: chalk.white.bold(" Title:"),
22
- labelBio: chalk.white.bold(" Bio:"),
23
- labelUpwork: chalk.white.bold(" Upwork:"),
24
- labelGitHub: chalk.white.bold(" GitHub:"),
25
- labelLinkedIn: chalk.white.bold(" LinkedIn:"),
26
- labelWeb: chalk.white.bold(" Website:"),
27
- labelEmail: chalk.white.bold(" Email:"),
28
- labelSkills: chalk.white.bold(" Skills:"),
29
- labelCard: chalk.white.bold(" Card:"),
30
- };
3
+ import { readFileSync } from "node:fs";
31
4
 
32
- // Create the output
33
- const output = `
34
- ${data.name} / ${data.handle}
35
-
36
- ${data.labelWork} ${data.work}
37
- ${data.labelEmail} ${data.email}
38
- ${data.labelUpwork} ${data.upwork}
39
- ${data.labelGitHub} ${data.github}
40
- ${data.labelLinkedIn} ${data.linkedin}
41
- ${data.labelWeb} ${data.website}
42
- ${data.labelSkills} ${data.skills}
43
- ${data.labelBio} ${data.bio}
44
- `;
45
-
46
- console.log(
47
- boxen(output, {
48
- padding: 1,
49
- margin: 1,
50
- borderStyle: "round",
51
- borderColor: "green",
52
- })
5
+ const { version } = JSON.parse(
6
+ readFileSync(new URL("./package.json", import.meta.url), "utf8"),
53
7
  );
8
+
9
+ const projects = [
10
+ {
11
+ name: "D1 Preflight",
12
+ area: "RUST / DATABASES",
13
+ detail: "Checks migration risks against disposable SQLite snapshots.",
14
+ url: "https://github.com/ranajahanzaib/d1-preflight",
15
+ },
16
+ {
17
+ name: "Ledger-to-Chain Reconciler",
18
+ area: "GO / BLOCKCHAIN",
19
+ detail: "Compares deposit ledgers with ERC-20 transfer evidence, read-only.",
20
+ url: "https://github.com/ranajahanzaib/ledger-to-chain-reconciler",
21
+ },
22
+ {
23
+ name: "Workers Aide",
24
+ area: "TYPESCRIPT / CLOUDFLARE",
25
+ detail: "Self-hosted business assistants with D1 and Durable Objects.",
26
+ url: "https://github.com/ranajahanzaib/workers-aide",
27
+ },
28
+ ];
29
+
30
+ const contacts = [
31
+ ["WORK", "https://workwithrana.com/work"],
32
+ ["EMAIL", "work@withrana.com"],
33
+ ["GITHUB", "https://github.com/ranajahanzaib"],
34
+ ["LINKEDIN", "https://linkedin.com/in/workwithrana"],
35
+ ["UPWORK", "https://upwork.com/fl/rana"],
36
+ ];
37
+
38
+ const useColor =
39
+ Boolean(process.stdout.isTTY) &&
40
+ !process.env.NO_COLOR &&
41
+ process.env.TERM !== "dumb";
42
+ const palette = {
43
+ accent: "\u001b[38;2;242;176;96m",
44
+ link: "\u001b[38;2;119;208;213m",
45
+ muted: "\u001b[38;2;150;161;177m",
46
+ border: "\u001b[38;2;94;108;126m",
47
+ bright: "\u001b[1;38;2;245;247;250m",
48
+ };
49
+ const reset = "\u001b[0m";
50
+ const paint = (text, tone) =>
51
+ useColor && tone ? `${palette[tone]}${text}${reset}` : text;
52
+
53
+ function wrap(text, width) {
54
+ const words = text.split(/\s+/);
55
+ const lines = [];
56
+ let line = "";
57
+ for (let word of words) {
58
+ while (word.length > width) {
59
+ if (line) {
60
+ lines.push(line);
61
+ line = "";
62
+ }
63
+ const fragment = word.slice(0, width);
64
+ const slash = fragment.lastIndexOf("/");
65
+ const cut = slash > 2 && slash < width - 3 ? slash + 1 : width;
66
+ lines.push(word.slice(0, cut));
67
+ word = word.slice(cut);
68
+ }
69
+ if (!word) continue;
70
+ if (line && line.length + word.length + 1 > width) {
71
+ lines.push(line);
72
+ line = word;
73
+ } else {
74
+ line += (line ? " " : "") + word;
75
+ }
76
+ }
77
+ if (line) lines.push(line);
78
+ return lines;
79
+ }
80
+
81
+ function renderCard() {
82
+ const requestedWidth = Number(process.stdout.columns || process.env.COLUMNS || 82);
83
+ const width = Math.max(24, Math.min(requestedWidth - 1, 86));
84
+ const inside = width - 2;
85
+ const contentWidth = inside - 4;
86
+ const compact = width < 42;
87
+ const lines = [];
88
+
89
+ function edge(left, right, label = "") {
90
+ const title = label ? `─ ${label} ` : "";
91
+ const fill = "─".repeat(inside - title.length);
92
+ lines.push(paint(left + title + fill + right, "border"));
93
+ }
94
+
95
+ function row(text = "", tone) {
96
+ const padding = " ".repeat(Math.max(0, contentWidth - text.length));
97
+ lines.push(
98
+ paint("│ ", "border") +
99
+ paint(text, tone) +
100
+ padding +
101
+ paint(" │", "border"),
102
+ );
103
+ }
104
+
105
+ function paragraph(text, indent = 0, tone) {
106
+ for (const part of wrap(text, contentWidth - indent)) {
107
+ row(" ".repeat(indent) + part, tone);
108
+ }
109
+ }
110
+
111
+ edge("╭", "╮", "WORKWITHRANA");
112
+ row();
113
+ row("RANA JAHANZAIB", "accent");
114
+ paragraph("Senior full-stack engineer", 0, "bright");
115
+ paragraph("Backend · cloud · product", 0, "muted");
116
+ row();
117
+ paragraph(
118
+ "I build business applications, developer tools, and cloud systems. My work spans independent delivery and technical leadership across products.",
119
+ );
120
+ row();
121
+
122
+ edge("├", "┤", "SELECTED WORK");
123
+ projects.forEach((project, index) => {
124
+ row();
125
+ if (compact) {
126
+ row(String(index + 1).padStart(2, "0"), "accent");
127
+ paragraph(project.name, 4, "bright");
128
+ } else {
129
+ paragraph(`${String(index + 1).padStart(2, "0")} ${project.name}`, 0, "bright");
130
+ }
131
+ paragraph(project.area, 4, "accent");
132
+ paragraph(project.detail, 4);
133
+ if (!compact) paragraph(project.url, 4, "link");
134
+ });
135
+ row();
136
+
137
+ edge("├", "┤", "CONNECT");
138
+ row();
139
+ for (const [label, value] of contacts) {
140
+ const entry = `${label.padEnd(10)}${value}`;
141
+ if (entry.length <= contentWidth) row(entry, "link");
142
+ else {
143
+ row(label, "accent");
144
+ paragraph(value, 2, "link");
145
+ }
146
+ }
147
+ row();
148
+ edge("╰", "╯");
149
+
150
+ console.log("\n" + lines.join("\n") + "\n");
151
+ }
152
+
153
+ const args = process.argv.slice(2);
154
+ if (args.includes("--help") || args.includes("-h")) {
155
+ console.log(
156
+ "Usage: npx workwithrana [--help] [--version]\n\nPrint Rana Jahanzaib's engineering profile and selected projects.",
157
+ );
158
+ } else if (args.includes("--version") || args.includes("-v")) {
159
+ console.log(version);
160
+ } else if (args.length) {
161
+ console.error(`Unknown option: ${args[0]}. Run with --help for usage.`);
162
+ process.exitCode = 1;
163
+ } else {
164
+ renderCard();
165
+ }
package/package.json CHANGED
@@ -1,13 +1,30 @@
1
1
  {
2
2
  "name": "workwithrana",
3
- "version": "0.0.1",
4
- "description": "Rana's resume in the terminal",
3
+ "version": "0.0.3",
4
+ "description": "Rana Jahanzaib's engineering profile and selected projects in the terminal",
5
5
  "type": "module",
6
6
  "bin": {
7
- "rana": "./index.js"
7
+ "workwithrana": "./index.js"
8
8
  },
9
- "dependencies": {
10
- "chalk": "^5.3.0",
11
- "boxen": "^7.1.1"
9
+ "files": [
10
+ "index.js",
11
+ "README.md"
12
+ ],
13
+ "repository": {
14
+ "type": "git",
15
+ "url": "git+https://github.com/ranajahanzaib/npx-workwithrana.git"
16
+ },
17
+ "homepage": "https://workwithrana.com",
18
+ "bugs": {
19
+ "url": "https://github.com/ranajahanzaib/npx-workwithrana/issues"
20
+ },
21
+ "keywords": [
22
+ "workwithrana",
23
+ "portfolio",
24
+ "engineering",
25
+ "terminal"
26
+ ],
27
+ "scripts": {
28
+ "test": "node --test"
12
29
  }
13
30
  }