pulp-image 0.1.2 → 0.1.4

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/README.md CHANGED
@@ -24,7 +24,7 @@ Install pulp-image globally using npm:
24
24
  npm install -g pulp-image
25
25
  ```
26
26
 
27
- This will make the `pulp` command available globally on your system.
27
+ This is a global CLI. Installing with `-g` makes the `pulp` command available system-wide.
28
28
 
29
29
  ### Requirements
30
30
 
package/bin/pulp.js CHANGED
@@ -13,7 +13,7 @@ const pkg = JSON.parse(
13
13
 
14
14
  import { Command } from 'commander';
15
15
  import chalk from 'chalk';
16
- import { banner } from '../src/banner.js';
16
+ import { getBanner } from '../src/banner.js';
17
17
  import { formatBytes } from '../src/stats.js';
18
18
  import { planTasks } from '../src/planTasks.js';
19
19
  import { Reporter } from '../src/reporter.js';
@@ -22,6 +22,7 @@ import { startUIServer } from '../src/uiServer.js';
22
22
  import { statSync, existsSync } from 'fs';
23
23
 
24
24
  const program = new Command();
25
+ const banner = getBanner(pkg.version);
25
26
 
26
27
  program
27
28
  .name('pulp')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pulp-image",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "description": "A CLI tool for processing images with resize, format conversion, and optimization",
5
5
  "type": "module",
6
6
  "main": "bin/pulp.js",
package/src/banner.js CHANGED
@@ -1,10 +1,33 @@
1
- export const banner = `
2
- ╔════════════════════════════════════════╗
3
- ║ ║
4
- ║ pulp-image v0.1.0 ║
5
- ║ ║
6
- ║ Image processing made simple ║
7
- ║ ║
8
- ╚════════════════════════════════════════╝
1
+ export const getBanner = (version) => {
2
+ const title = `🍊 pulp-image v${version}`;
3
+ const subtitle = `Image processing made simple`;
4
+
5
+ // Calculate width: use the longest line + padding
6
+ const contentWidth = Math.max(title.length, subtitle.length);
7
+ const padding = 4; // 2 spaces on each side
8
+ const width = contentWidth + padding;
9
+
10
+ // Generate borders
11
+ const topBorder = `╔${'═'.repeat(width)}╗`;
12
+ const bottomBorder = `╚${'═'.repeat(width)}╝`;
13
+ const emptyLine = `║${' '.repeat(width)}║`;
14
+
15
+ // Center the text lines
16
+ const centerText = (text, totalWidth) => {
17
+ const spaces = totalWidth - text.length;
18
+ const leftPad = Math.floor(spaces / 2);
19
+ const rightPad = spaces - leftPad;
20
+ return `║${' '.repeat(leftPad)}${text}${' '.repeat(rightPad)}║`;
21
+ };
22
+
23
+ return `
24
+ ${topBorder}
25
+ ${emptyLine}
26
+ ${centerText(title, width)}
27
+ ${emptyLine}
28
+ ${centerText(subtitle, width)}
29
+ ${emptyLine}
30
+ ${bottomBorder}
9
31
  `;
32
+ };
10
33