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 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
- > Automatically compress images to exact file size using binary search algorithm. No more "file too large" errors.
3
+ Automatically compress images to exact file size using binary search algorithm.
4
4
 
5
- ## Why ImgCap?
5
+ [![version](https://img.shields.io/github/v/release/molvqingtai/imgcap)](https://www.npmjs.com/package/imgcap) [![workflow](https://github.com/molvqingtai/imgcap/actions/workflows/ci.yml/badge.svg)](https://github.com/molvqingtai/imgcap/actions) [![download](https://img.shields.io/npm/dt/imgcap)](https://www.npmjs.com/package/imgcap) [![npm package minimized gzipped size](https://img.shields.io/bundlejs/size/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
- ## Installation
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
- ## API
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
- ## License
52
+ ### License
53
53
 
54
54
  MIT © [molvqingtai](https://github.com/molvqingtai)
@@ -0,0 +1,8 @@
1
+ # tests
2
+
3
+ Run
4
+
5
+ ```
6
+ pnpm install
7
+ pnpm test
8
+ ```
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "__tests__",
3
3
  "version": "1.0.0",
4
- "description": "",
4
+ "description": "Automatically compress images to exact file size using binary search algorithm.",
5
5
  "main": "index.js",
6
6
  "scripts": {
7
7
  "test": "vitest --browser.headless",
package/core/README.md ADDED
@@ -0,0 +1,8 @@
1
+ # core
2
+
3
+ Run
4
+
5
+ ```
6
+ pnpm install
7
+ pnpm dev
8
+ ```
package/core/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "core",
3
3
  "version": "1.0.0",
4
- "description": "Precisely cap your image size.",
4
+ "description": "Automatically compress images to exact file size using binary search algorithm.",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
7
7
  "scripts": {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "imgcap",
3
- "version": "1.0.0",
4
- "description": "Precisely cap your image size.",
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",