beautiful-image 0.1.6 → 0.1.7
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 +5 -9
- package/beautiful_image_bg.js +0 -4
- package/beautiful_image_bg.wasm +0 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -24,11 +24,10 @@ npm i beautiful-image
|
|
|
24
24
|
|
|
25
25
|
## Usage
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
import init, { optimizeImage, ResizeMode } from "beautiful-image";
|
|
27
|
+
Works with any modern bundler (Vite, Webpack, Rollup) and framework (React, Vue, Angular, Svelte).
|
|
29
28
|
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
```javascript
|
|
30
|
+
import { optimizeImage, ResizeMode } from "beautiful-image";
|
|
32
31
|
```
|
|
33
32
|
|
|
34
33
|
### API
|
|
@@ -48,10 +47,7 @@ optimizeImage(bytes, width, quality, mode)
|
|
|
48
47
|
### Examples
|
|
49
48
|
|
|
50
49
|
```javascript
|
|
51
|
-
import
|
|
52
|
-
|
|
53
|
-
// Initialize WASM
|
|
54
|
-
await init();
|
|
50
|
+
import { optimizeImage, ResizeMode } from "beautiful-image";
|
|
55
51
|
|
|
56
52
|
// Get image bytes from a file input
|
|
57
53
|
const file = document.getElementById('upload').files[0];
|
|
@@ -78,7 +74,7 @@ If you want to build the package yourself:
|
|
|
78
74
|
|
|
79
75
|
```bash
|
|
80
76
|
cargo install wasm-pack
|
|
81
|
-
wasm-pack build --target
|
|
77
|
+
wasm-pack build --target bundler --release
|
|
82
78
|
```
|
|
83
79
|
|
|
84
80
|
## License
|
package/beautiful_image_bg.js
CHANGED
|
@@ -85,10 +85,6 @@ export function __wbg___wbindgen_throw_dd24417ed36fc46e(arg0, arg1) {
|
|
|
85
85
|
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
86
86
|
};
|
|
87
87
|
|
|
88
|
-
export function __wbg_log_15eeaabaa0fe989d(arg0, arg1) {
|
|
89
|
-
console.log(getStringFromWasm0(arg0, arg1));
|
|
90
|
-
};
|
|
91
|
-
|
|
92
88
|
export function __wbindgen_cast_2241b6af4c4b2941(arg0, arg1) {
|
|
93
89
|
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
94
90
|
const ret = getStringFromWasm0(arg0, arg1);
|
package/beautiful_image_bg.wasm
CHANGED
|
Binary file
|