imgcap 1.0.0 → 1.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/CHANGELOG.md +7 -0
- package/README.md +11 -11
- package/__tests__/README.md +8 -0
- package/__tests__/package.json +1 -1
- package/core/README.md +8 -0
- package/core/package.json +1 -1
- package/package.json +10 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## [1.0.1](https://github.com/molvqingtai/imgcap/compare/v1.0.0...v1.0.1) (2025-07-14)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Performance Improvements
|
|
5
|
+
|
|
6
|
+
* add npm link ([19857c0](https://github.com/molvqingtai/imgcap/commit/19857c0c6a1465a56b2707373e5ba70151ea56f7))
|
|
7
|
+
|
|
1
8
|
# 1.0.0 (2025-07-14)
|
|
2
9
|
|
|
3
10
|
|
package/README.md
CHANGED
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
# ImgCap
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Automatically compress images to exact file size using binary search algorithm.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
[](https://www.npmjs.com/package/imgcap) [](https://github.com/molvqingtai/imgcap/actions) [](https://www.npmjs.com/package/imgcap) [](https://www.npmjs.com/package/imgcap)
|
|
6
|
+
|
|
7
|
+
```shell
|
|
8
|
+
pnpm install imgcap
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
### Why ImgCap?
|
|
6
12
|
|
|
7
13
|
Users often encounter "File too large" errors when uploading images, forcing them to manually compress files using external tools. This creates friction and leads to user dropout. imgcap solves this by automatically compressing images to exact size requirements - no user intervention needed.
|
|
8
14
|
|
|
@@ -14,13 +20,7 @@ Users often encounter "File too large" errors when uploading images, forcing the
|
|
|
14
20
|
✅ await imgcap(userPhoto, { targetSize: 2 * 1024 * 1024 })
|
|
15
21
|
```
|
|
16
22
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
```bash
|
|
20
|
-
pnpm install imgcap
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
## Usage
|
|
23
|
+
### Usage
|
|
24
24
|
|
|
25
25
|
```typescript
|
|
26
26
|
import imgcap from 'imgcap'
|
|
@@ -35,7 +35,7 @@ const webp = await imgcap(imageFile, {
|
|
|
35
35
|
})
|
|
36
36
|
```
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
### API
|
|
39
39
|
|
|
40
40
|
```typescript
|
|
41
41
|
interface Options {
|
|
@@ -49,6 +49,6 @@ type ImageType = 'image/jpeg' | 'image/png' | 'image/webp' | 'image/avif'
|
|
|
49
49
|
|
|
50
50
|
**Browser only** - Requires OffscreenCanvas support (modern browsers).
|
|
51
51
|
|
|
52
|
-
|
|
52
|
+
### License
|
|
53
53
|
|
|
54
54
|
MIT © [molvqingtai](https://github.com/molvqingtai)
|
package/__tests__/package.json
CHANGED
package/core/README.md
ADDED
package/core/package.json
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "imgcap",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"description": "Automatically compress images to exact file size using binary search algorithm.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "core/dist/index.js",
|
|
7
7
|
"scripts": {
|
|
@@ -30,8 +30,6 @@
|
|
|
30
30
|
"avif",
|
|
31
31
|
"jpeg",
|
|
32
32
|
"png",
|
|
33
|
-
"browser",
|
|
34
|
-
"typescript",
|
|
35
33
|
"upload",
|
|
36
34
|
"quality",
|
|
37
35
|
"canvas",
|
|
@@ -39,6 +37,14 @@
|
|
|
39
37
|
],
|
|
40
38
|
"author": "molvqingtai",
|
|
41
39
|
"license": "MIT",
|
|
40
|
+
"repository": {
|
|
41
|
+
"type": "git",
|
|
42
|
+
"url": "https://github.com/molvqingtai/imgcap.git"
|
|
43
|
+
},
|
|
44
|
+
"bugs": {
|
|
45
|
+
"url": "https://github.com/molvqingtai/imgcap/issues"
|
|
46
|
+
},
|
|
47
|
+
"homepage": "https://github.com/molvqingtai/imgcap#readme",
|
|
42
48
|
"devDependencies": {
|
|
43
49
|
"@commitlint/cli": "^19.8.1",
|
|
44
50
|
"@commitlint/config-conventional": "^19.8.1",
|