@akurasiudara/img2webp 1.1.0 → 1.2.0

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/INSTALL.md ADDED
@@ -0,0 +1,133 @@
1
+ # Installation Guide
2
+
3
+ This guide covers various ways to install and use `img2webp`.
4
+
5
+ ## Package Managers
6
+
7
+ ### npm (Node Package Manager)
8
+ ```bash
9
+ # Global installation
10
+ npm install -g @akurasiudara/img2webp
11
+
12
+ # Local installation in project
13
+ npm install @akurasiudara/img2webp
14
+
15
+ # One-time use without installation
16
+ npx @akurasiudara/img2webp photo.jpg 85
17
+ ```
18
+
19
+ ### yarn
20
+ ```bash
21
+ # Global installation
22
+ yarn global add @akurasiudara/img2webp
23
+
24
+ # Local installation in project
25
+ yarn add @akurasiudara/img2webp
26
+
27
+ # One-time use
28
+ yarn dlx @akurasiudara/img2webp photo.jpg 85
29
+ ```
30
+
31
+ ### pnpm (Performant npm)
32
+ ```bash
33
+ # Global installation
34
+ pnpm install -g @akurasiudara/img2webp
35
+
36
+ # Local installation
37
+ pnpm install @akurasiudara/img2webp
38
+
39
+ # One-time use
40
+ pnpm dlx @akurasiudara/img2webp photo.jpg 85
41
+ ```
42
+
43
+ ### bun (Fast all-in-one toolkit)
44
+ ```bash
45
+ # Global installation
46
+ bun install -g @akurasiudara/img2webp
47
+
48
+ # Local installation
49
+ bun install @akurasiudara/img2webp
50
+
51
+ # One-time use
52
+ bunx @akurasiudara/img2webp photo.jpg 85
53
+ ```
54
+
55
+ ## Direct Installation
56
+
57
+ ### From GitHub
58
+ ```bash
59
+ # npm
60
+ npm install -g github:akurasiudara/img2webp
61
+
62
+ # yarn
63
+ yarn global add github:akurasiudara/img2webp
64
+
65
+ # pnpm
66
+ pnpm install -g github:akurasiudara/img2webp
67
+
68
+ # bun
69
+ bun install -g github:akurasiudara/img2webp
70
+ ```
71
+
72
+ ### From tarball
73
+ ```bash
74
+ npm install -g https://github.com/akurasiudara/img2webp/archive/main.tar.gz
75
+ ```
76
+
77
+ ## Verification
78
+
79
+ After installation, verify it works:
80
+
81
+ ```bash
82
+ # Check version
83
+ img2webp --version
84
+
85
+ # Show help
86
+ img2webp --help
87
+
88
+ # Test conversion (if you have a test image)
89
+ img2webp test.jpg 85
90
+ ```
91
+
92
+ ## Troubleshooting
93
+
94
+ ### Command not found
95
+ If you get "command not found" error:
96
+
97
+ ```bash
98
+ # Check npm global bin directory
99
+ npm config get prefix
100
+
101
+ # Add to PATH (add to ~/.bashrc or ~/.zshrc)
102
+ export PATH="$(npm config get prefix)/bin:$PATH"
103
+ ```
104
+
105
+ ### Permission errors on Linux/macOS
106
+ ```bash
107
+ # Option 1: Use sudo (not recommended)
108
+ sudo npm install -g @akurasiudara/img2webp
109
+
110
+ # Option 2: Configure npm to use different directory
111
+ npm config set prefix ~/.local
112
+ export PATH="~/.local/bin:$PATH"
113
+ ```
114
+
115
+ ### Windows specific
116
+ - Use Git Bash, WSL, or PowerShell with bash available
117
+ - Consider using Windows Package Manager in the future
118
+
119
+ ## Uninstall
120
+
121
+ ```bash
122
+ # npm
123
+ npm uninstall -g @akurasiudara/img2webp
124
+
125
+ # yarn
126
+ yarn global remove @akurasiudara/img2webp
127
+
128
+ # pnpm
129
+ pnpm uninstall -g @akurasiudara/img2webp
130
+
131
+ # bun
132
+ bun remove -g @akurasiudara/img2webp
133
+ ```
package/README.md CHANGED
@@ -4,16 +4,81 @@ Simple command-line tool to convert images (JPG, JPEG, PNG) to WebP format.
4
4
 
5
5
  ## Installation
6
6
 
7
+ ### Via npm
7
8
  ```bash
8
9
  npm install -g @akurasiudara/img2webp
9
10
  ```
10
11
 
11
- **That's it!** The package includes all necessary WebP conversion tools automatically.
12
+ ### Via yarn
13
+ ```bash
14
+ yarn global add @akurasiudara/img2webp
15
+ ```
16
+
17
+ ### Via pnpm
18
+ ```bash
19
+ pnpm install -g @akurasiudara/img2webp
20
+ ```
21
+
22
+ ### Via bun
23
+ ```bash
24
+ bun install -g @akurasiudara/img2webp
25
+ ```
26
+
27
+ ### Alternative Installation Methods
28
+
29
+ #### Direct from GitHub
30
+ ```bash
31
+ # Via npm
32
+ npm install -g akurasiudara/img2webp
33
+
34
+ # Via bun
35
+ bun install -g github:akurasiudara/img2webp
36
+ ```
37
+
38
+ #### Using npx (No Installation Required)
39
+ ```bash
40
+ npx @akurasiudara/img2webp --help
41
+ npx @akurasiudara/img2webp photo.jpg 85
42
+ ```
43
+
44
+ #### Using bunx (Bun equivalent of npx)
45
+ ```bash
46
+ bunx @akurasiudara/img2webp --help
47
+ bunx @akurasiudara/img2webp photo.jpg 85
48
+ ```
49
+
50
+ ### Package Manager Compatibility
51
+
52
+ | Package Manager | Command | Status |
53
+ |----------------|---------|---------|
54
+ | **npm** | `npm install -g @akurasiudara/img2webp` | ✅ Full support |
55
+ | **yarn** | `yarn global add @akurasiudara/img2webp` | ✅ Full support |
56
+ | **pnpm** | `pnpm install -g @akurasiudara/img2webp` | ✅ Full support |
57
+ | **bun** | `bun install -g @akurasiudara/img2webp` | ✅ Full support |
58
+ | **npx** | `npx @akurasiudara/img2webp` | ✅ No installation needed |
59
+ | **bunx** | `bunx @akurasiudara/img2webp` | ✅ No installation needed |
12
60
 
13
61
  ### Requirements
14
- - **Node.js** (v12 or higher)
62
+ - **Node.js** (v12 or higher) or **Bun runtime**
15
63
  - **bash** (available on Linux/macOS, on Windows use WSL or Git Bash)
16
64
 
65
+ ## Platform Support
66
+
67
+ ### Operating Systems
68
+ - ✅ **Linux** (x64, arm64)
69
+ - ✅ **macOS** (Intel, Apple Silicon)
70
+ - ✅ **Windows** (x64) with WSL/Git Bash
71
+
72
+ ### JavaScript Runtimes
73
+ - ✅ **Node.js** v12+
74
+ - ✅ **Bun** v0.1+
75
+
76
+ ### Package Managers
77
+ - ✅ **npm** (Node Package Manager)
78
+ - ✅ **yarn** (Yet Another Resource Negotiator)
79
+ - ✅ **pnpm** (Performant npm)
80
+ - ✅ **bun** (Fast all-in-one toolkit)
81
+
17
82
  ## Usage
18
83
 
19
84
  ### Basic Commands
package/bin/img2webp CHANGED
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env node
1
+ #!/usr/bin/env node
2
2
 
3
3
  const { spawn } = require('child_process');
4
4
  const path = require('path');
@@ -13,9 +13,9 @@ if (!fs.existsSync(scriptPath)) {
13
13
  process.exit(1);
14
14
  }
15
15
 
16
- // Set environment variable untuk cwebp-bin path
17
- const cwebpPath = require('cwebp-bin');
18
- process.env.CWEBP_PATH = cwebpPath;
16
+ // Set environment variable untuk libwebp-static path
17
+ const libwebpStatic = require('libwebp-static');
18
+ process.env.CWEBP_PATH = libwebpStatic.cwebp;
19
19
 
20
20
  // Ambil arguments dari command line
21
21
  const args = process.argv.slice(2);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akurasiudara/img2webp",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "description": "Simple command-line tool to convert images to WebP format",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -9,20 +9,22 @@
9
9
  "scripts": {
10
10
  "test": "echo \"Error: no test specified\" && exit 1"
11
11
  },
12
- "keywords": ["webp", "image", "converter", "cli", "img2webp"],
12
+ "keywords": ["webp", "image", "converter", "cli", "img2webp", "bun", "yarn", "pnpm", "cross-platform"],
13
13
  "author": "Ifan Irfansyah",
14
14
  "license": "MIT",
15
15
  "engines": {
16
- "node": ">=12.0.0"
16
+ "node": ">=12.0.0",
17
+ "bun": ">=0.1.0"
17
18
  },
18
19
  "files": [
19
20
  "bin/",
20
21
  "webp.sh",
21
22
  "README.md",
23
+ "INSTALL.md",
22
24
  "LICENSE"
23
25
  ],
24
26
  "dependencies": {
25
- "cwebp-bin": "^7.1.0"
27
+ "libwebp-static": "^1.0.4"
26
28
  },
27
29
  "repository": {
28
30
  "type": "git",
package/webp.sh CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env bash
2
2
 
3
3
  # Version and help
4
- VERSION="1.0.0"
4
+ VERSION="1.2.0"
5
5
  SCRIPT_NAME="img2webp"
6
6
 
7
7
  show_help() {