haswinmurali 1.0.0 → 1.0.2
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/index.js
CHANGED
|
@@ -1,36 +1,47 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import fs from "fs";
|
|
3
3
|
import path from "path";
|
|
4
|
+
import { fileURLToPath } from "url";
|
|
5
|
+
|
|
6
|
+
// This ensures the script finds haswin.txt inside your package folder
|
|
7
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
8
|
+
const artFile = path.join(__dirname, "haswin.txt");
|
|
4
9
|
|
|
5
10
|
// --------- CONFIG ---------
|
|
6
|
-
const artFile = path.join(process.cwd(), "haswin.txt"); // colored ASCII file
|
|
7
11
|
const textLines = [
|
|
8
12
|
"Hi, I'm Haswin 👋",
|
|
9
13
|
"I build terminal projects.",
|
|
10
|
-
"GitHub: https://github.com/
|
|
11
|
-
"
|
|
14
|
+
"GitHub: https://github.com/haswin2410",
|
|
15
|
+
"Portfolio: https://npmjs.com/package/haswinmurali",
|
|
12
16
|
];
|
|
13
17
|
// ---------------------------
|
|
14
18
|
|
|
15
19
|
// Read the ASCII art
|
|
16
20
|
let art;
|
|
17
21
|
try {
|
|
18
|
-
|
|
22
|
+
// Read file and split into lines
|
|
23
|
+
const data = fs.readFileSync(artFile, "utf8");
|
|
24
|
+
art = data.split("\n");
|
|
19
25
|
} catch (err) {
|
|
20
|
-
console.error("Error:
|
|
26
|
+
console.error("Error: haswin.txt not found in the package directory!");
|
|
21
27
|
process.exit(1);
|
|
22
28
|
}
|
|
23
29
|
|
|
24
30
|
// Prepare text lines for right side
|
|
25
|
-
const maxArtLines = art.length;
|
|
31
|
+
const maxArtLines = Math.max(art.length, textLines.length);
|
|
26
32
|
const paddedText = [...textLines];
|
|
27
33
|
while (paddedText.length < maxArtLines) paddedText.push("");
|
|
28
34
|
|
|
29
35
|
// Print side by side
|
|
36
|
+
console.log("\n"); // Add a little top breathing room
|
|
30
37
|
for (let i = 0; i < maxArtLines; i++) {
|
|
31
38
|
const left = art[i] || "";
|
|
32
39
|
const right = paddedText[i] || "";
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
40
|
+
|
|
41
|
+
// Basic padding to keep the text aligned if art lines vary in length
|
|
42
|
+
// You might need to adjust the number 40 based on your ASCII width
|
|
43
|
+
const artPadding = " ".repeat(Math.max(0, 40 - left.length));
|
|
44
|
+
|
|
45
|
+
console.log(left + artPadding + " " + right);
|
|
46
|
+
}
|
|
47
|
+
console.log("\n");
|
package/package.json
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "haswinmurali",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
|
+
"description": "My CLI Portfolio",
|
|
5
|
+
"main": "index.js",
|
|
4
6
|
"bin": {
|
|
5
|
-
"
|
|
7
|
+
"haswinmurali": "./index.js"
|
|
6
8
|
},
|
|
7
9
|
"type": "module",
|
|
8
|
-
"
|
|
10
|
+
"keywords": [],
|
|
11
|
+
"author": "",
|
|
12
|
+
"license": "ISC"
|
|
9
13
|
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
⢀⣿⠚⠙⠛⠷⣶⣶⣶⣦⡴⠶⠶⠶⠶⣶⣶⣶⣶⣶⣶⣦⣮⣿⣯⣤
|
|
2
|
-
⠟⣿⠀⠀⠀⡐⠸⣿⣿⠏⢀⣼⣿⣿⣿⣿⢻⣿⡛⢁⣿⣿⣿⣿⣷⣿
|
|
3
|
-
⠀⡟⠀⠀⣠⣦⡀⣿⠃⠀⣼⣿⣿⣿⣿⣿⠛⠉⣁⣸⣻⣿⣿⣿⣿⣿
|
|
4
|
-
⠀⡇⠀⢀⣬⢋⡃⡿⠀⠤⠈⠟⠉⠈⠁⠀⠀⠈⠋⠻⠍⢻⣿⣿⣿⣿
|
|
5
|
-
⠀⡇⠀⠰⣮⣭⠁⣁⠀⠰⠀⠀⠀⠀⢀⣀⣀⣀⠀⠀⠀⠀⠘⣿⣿⣿
|
|
6
|
-
⠀⡇⠀⠀⠛⠀⠀⡀⢰⢀⣄⠀⣴⣾⣿⣿⣿⣿⣷⣶⣦⡄⠀⢹⣿⣿
|
|
7
|
-
⠀⣧⠀⠀⠀⢈⠆⠇⠠⠈⡍⢰⣿⣿⣛⠫⣿⣿⣿⣿⣿⣿⣖⡄⢿⡿
|
|
8
|
-
⠀⣯⣷⣦⣀⢨⣤⢷⣠⣤⣧⢀⡄⢸⣿⣶⣶⣿⣿⣿⣿⣿⣾⠁⢊⣠
|
|
9
|
-
⠀⣯⠭⡿⣿⣸⣿⠛⢻⣿⣿⣿⣿⡿⣟⣿⣿⣿⣿⣿⣿⣿⠁⣾⣿⣿
|
|
10
|
-
⠀⣿⣷⣿⡆⡇⣿⣠⣾⡏⣿⣿⣿⡟⣈⣭⣭⣿⣿⣿⣿⣿⣯⣿⣿⣿
|
|
11
|
-
⠀⣿⣿⣿⡧⣿⣿⣻⠩⠁⠙⣿⣿⣿⣷⠿⠿⠿⣻⣿⣿⣿⣿⢿⡿⡿
|
|
12
|
-
⠀⡿⣿⣿⣩⣿⣽⣮⡀⡀⣰⣿⣿⡟⠐⠀⢣⠘⣿⣿⣿⡿⠋⠀⠱⠗
|
|
13
|
-
⠀⠙⠉⠛⢉⡉⠻⠿⣿⣿⣿⠻⠿⠃⠀⠀⣸⣶⣿⣿⠋⠀⠀⠀⠀⠀
|
|
14
|
-
⠀⠀⠀⢀⣬⣷⣭⣷⣉⣿⣿⣦⡀⠀⠀⢸⣿⣿⠟⠃⠀⠀⠀⠀⠀⠀
|
|
15
|
-
⠀⠀⣠⠀⢉⡍⣛⠛⢿⣿⣿⣿⣿⣆⠀⠈⠟⠁⠀⠀⠀⠀⠀⠀⠀⠀
|
|
16
|
-
⠀⠀⠟⠐⠻⡟⠿⡿⢿⣿⣿⣿⣿⣿⣿⣦⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
|
|
17
|
-
⠀⡀⣿⣿⣿⣽⣄⣤⣾⣿⣿⣿⣿⣿⣿⣿⣷⣄⠀⠀⠀⠀⠀⠀⠀⠀
|
|
18
|
-
⢸⣿⣿⣿⣿⣾⣯⡟⠀⠉⠛⠿⣿⣿⣿⣿⣿⣿⣦⠀⠀⠀⠀⠀⠀⠀
|
|
19
|
-
⢸⣿⣿⣿⣿⣿⣿⠇⠀⠀⠀⠀⠀⠙⢿⣿⣿⣿⣿⣷⡀⠀⠀⠀⠀⠀
|
|
20
|
-
⢸⣿⣿⣿⣿⣿⡿⠀⠀⠀⠀⠀⠀⠀⠘⣿⣿⣿⣿⣿⣿⣄⠀⠀⠀⠀
|