pompelmi 1.12.0 → 1.12.1
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/bin/pompelmi.js +30 -5
- package/package.json +1 -1
- package/pr_info.tmp +2 -0
package/bin/pompelmi.js
CHANGED
|
@@ -10,20 +10,45 @@ const pkg = require('../package.json');
|
|
|
10
10
|
// ── Logo ──────────────────────────────────────────────────────────────────────
|
|
11
11
|
|
|
12
12
|
async function printLogo() {
|
|
13
|
+
const titleLines = [
|
|
14
|
+
'\x1b[33mpompelmi\x1b[0m — ClamAV Antivirus Scanning for Node.js',
|
|
15
|
+
'\x1b[90mv' + pkg.version + ' • Zero dependencies • TCP • UNIX socket\x1b[0m',
|
|
16
|
+
];
|
|
17
|
+
|
|
13
18
|
try {
|
|
14
19
|
const terminalImage = (await import('terminal-image')).default;
|
|
15
20
|
const imgPath = path.join(__dirname, '../src/grapefruit.png');
|
|
16
21
|
if (fs.existsSync(imgPath)) {
|
|
17
22
|
const image = await terminalImage.file(imgPath, {
|
|
18
|
-
width:
|
|
19
|
-
height: '20%',
|
|
23
|
+
width: 24,
|
|
20
24
|
preserveAspectRatio: true,
|
|
21
25
|
});
|
|
22
|
-
|
|
26
|
+
|
|
27
|
+
const rawLines = image.split('\n');
|
|
28
|
+
// Drop trailing blank line that terminal-image appends
|
|
29
|
+
const imgLines = rawLines[rawLines.length - 1].trim() === ''
|
|
30
|
+
? rawLines.slice(0, -1)
|
|
31
|
+
: rawLines;
|
|
32
|
+
const pad = ' ';
|
|
33
|
+
const gap = ' ';
|
|
34
|
+
const maxRows = Math.max(imgLines.length, titleLines.length);
|
|
35
|
+
|
|
36
|
+
process.stdout.write('\n');
|
|
37
|
+
for (let i = 0; i < maxRows; i++) {
|
|
38
|
+
const imgPart = imgLines[i] ?? ' '.repeat(24);
|
|
39
|
+
const textPart = i === 0 ? titleLines[0]
|
|
40
|
+
: i === 1 ? titleLines[1]
|
|
41
|
+
: '';
|
|
42
|
+
process.stdout.write(pad + imgPart + gap + textPart + '\n');
|
|
43
|
+
}
|
|
44
|
+
process.stdout.write('\n');
|
|
45
|
+
return;
|
|
23
46
|
}
|
|
24
47
|
} catch (_) {}
|
|
25
|
-
|
|
26
|
-
|
|
48
|
+
|
|
49
|
+
// Fallback: text-only header
|
|
50
|
+
console.log('\n\x1b[33m pompelmi\x1b[0m — ClamAV Antivirus Scanning for Node.js');
|
|
51
|
+
console.log('\x1b[90m v' + pkg.version + ' • Zero dependencies • TCP • UNIX socket\x1b[0m\n');
|
|
27
52
|
}
|
|
28
53
|
|
|
29
54
|
// ── Argument parsing ──────────────────────────────────────────────────────────
|
package/package.json
CHANGED
package/pr_info.tmp
ADDED