wasm-image-optimization 0.0.1 → 0.0.3
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 +3 -1
- package/package.json +16 -3
package/README.md
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
# usage
|
|
4
4
|
|
|
5
|
+
Sample of Cloudflare Workers
|
|
6
|
+
|
|
5
7
|
```ts
|
|
6
8
|
import { optimizeImage } from 'wasm-image-optimization';
|
|
7
9
|
|
|
@@ -13,7 +15,7 @@ const handleRequest = async (
|
|
|
13
15
|
ctx: ExecutionContext
|
|
14
16
|
): Promise<Response> => {
|
|
15
17
|
const srcImage = await fetch(
|
|
16
|
-
'https://raw.githubusercontent.com/
|
|
18
|
+
'https://raw.githubusercontent.com/node-libraries/wasm-image-optimization/master/images/test01.jpg'
|
|
17
19
|
).then((res) => res.arrayBuffer());
|
|
18
20
|
const image = await optimizeImage({
|
|
19
21
|
image: srcImage,
|
package/package.json
CHANGED
|
@@ -1,12 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wasm-image-optimization",
|
|
3
3
|
"description": "Optimize images with wasm on edge runtime",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.3",
|
|
5
5
|
"main": "./dist/cjs/index.js",
|
|
6
6
|
"types": "./dist/cjs/index.d.ts",
|
|
7
7
|
"exports": {
|
|
8
|
-
"
|
|
9
|
-
|
|
8
|
+
".": {
|
|
9
|
+
"import": "./dist/cjs/index.js",
|
|
10
|
+
"types": "./dist/cjs/index.d.ts"
|
|
11
|
+
},
|
|
12
|
+
"./edge": {
|
|
13
|
+
"import": "./dist/esm/index.js",
|
|
14
|
+
"types": "./dist/esm/index.d.ts"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"typesVersions": {
|
|
18
|
+
"*": {
|
|
19
|
+
"*": [
|
|
20
|
+
"./dist/cjs/index.d.ts"
|
|
21
|
+
]
|
|
22
|
+
}
|
|
10
23
|
},
|
|
11
24
|
"license": "MIT",
|
|
12
25
|
"scripts": {
|