auto-image-converter 1.1.16 → 2.0.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/README.md +69 -0
- package/package.json +14 -1
package/README.md
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# 🖼️ Auto Image Converter
|
|
2
|
+
|
|
3
|
+
Automatically convert PNG, JPG, and JPEG images to WebP or AVIF format with real-time file watching.
|
|
4
|
+
|
|
5
|
+
### 🔗 GitHub repository: https://github.com/StoneZol/auto-image-converter
|
|
6
|
+
|
|
7
|
+
## 🚀 Features
|
|
8
|
+
|
|
9
|
+
🔄 Convert images to .webp or .avif
|
|
10
|
+
|
|
11
|
+
🔍 Recursive folder support
|
|
12
|
+
|
|
13
|
+
🗑️ Optional removal of original files
|
|
14
|
+
|
|
15
|
+
👀 Watch mode – automatically converts newly added images
|
|
16
|
+
|
|
17
|
+
⚙️ Easy configuration via image-converter.config.mjs
|
|
18
|
+
|
|
19
|
+
## 📦 Installation
|
|
20
|
+
|
|
21
|
+
`npm install auto-image-converter --save-dev`
|
|
22
|
+
|
|
23
|
+
## ⚙️ Configuration
|
|
24
|
+
|
|
25
|
+
Create a `image-converter.config.mjs` file in the root of your project:
|
|
26
|
+
|
|
27
|
+
```// Default configuration example
|
|
28
|
+
export default {
|
|
29
|
+
dir: "public", // Directory to scan for images
|
|
30
|
+
format: "webp", // Output format: 'webp' or 'avif'
|
|
31
|
+
quality: 80, // Quality (0–100)
|
|
32
|
+
recursive: true, // Search subdirectories
|
|
33
|
+
removeOriginal: true, // Remove original files after conversion
|
|
34
|
+
};
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## 🛠️ Usage
|
|
38
|
+
|
|
39
|
+
Add the following to your package.json:
|
|
40
|
+
|
|
41
|
+
```
|
|
42
|
+
"scripts": {
|
|
43
|
+
"aciw": "auto-convert-images-watch"
|
|
44
|
+
}
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
To start the image watcher: `npm run aciw`
|
|
48
|
+
|
|
49
|
+
Or run a one-time conversion: `npx auto-convert-images`
|
|
50
|
+
|
|
51
|
+
## With Next.js
|
|
52
|
+
|
|
53
|
+
To run the watcher alongside the development server, install concurrently:
|
|
54
|
+
|
|
55
|
+
`npm install concurrently --save-dev`
|
|
56
|
+
|
|
57
|
+
Then update your dev script like so:
|
|
58
|
+
|
|
59
|
+
```
|
|
60
|
+
"scripts": {
|
|
61
|
+
"dev": "concurrently \"npm run aciw\" \"next dev\""
|
|
62
|
+
}
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## 📄 License
|
|
66
|
+
|
|
67
|
+
This project is open source and available under the MIT License.
|
|
68
|
+
|
|
69
|
+
You are free to use, modify, and distribute it for personal and commercial purposes with proper attribution.
|
package/package.json
CHANGED
|
@@ -1,6 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "auto-image-converter",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.1",
|
|
4
|
+
"keywords": [
|
|
5
|
+
"image",
|
|
6
|
+
"converter",
|
|
7
|
+
"webp",
|
|
8
|
+
"avif",
|
|
9
|
+
"sharp",
|
|
10
|
+
"watch",
|
|
11
|
+
"optimization",
|
|
12
|
+
"png",
|
|
13
|
+
"jpg",
|
|
14
|
+
"jpeg",
|
|
15
|
+
"cli"
|
|
16
|
+
],
|
|
4
17
|
"type": "module",
|
|
5
18
|
"bin": {
|
|
6
19
|
"auto-convert-images": "./bin/index.js",
|