wasm-html-to-image 0.1.0 → 0.1.2
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 +20 -19
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
[](https://www.npmjs.com/package/wasm-html-to-image)
|
|
5
5
|
[](https://github.com/SoraKumo001/wasm-html-to-image/blob/master/LICENSE)
|
|
6
6
|
[](https://sorakumo001.github.io/wasm-html-to-image/master)
|
|
7
|
-
[](https://sorakumo001.github.io/wasm-html-to-image/)
|
|
7
|
+
[](https://sorakumo001.github.io/wasm-html-to-image/master/docs/)
|
|
8
|
+
[](https://github.com/SoraKumo001/wasm-html-to-image-samples)
|
|
8
9
|
|
|
9
10
|
A high-performance, WebAssembly-powered HTML-to-image renderer and image optimization engine. It consolidates HTML rendering (**Satoru** / **Skia** / **litehtml**) and native image encoding (**WebP / AVIF / JPEG**) into a single, unified WASM binary.
|
|
10
11
|
|
|
@@ -142,17 +143,16 @@ await fs.writeFile("animation.webp", Buffer.from(animatedWebp.data));
|
|
|
142
143
|
|
|
143
144
|
All formats return a `RenderResult<T>` object containing `.data` (`Uint8Array` or `string` for SVG) and metadata (`width`, `height`, `originalWidth`, `originalHeight`, `format`, `isAnimated`):
|
|
144
145
|
|
|
145
|
-
| Format | `result.data` Type | HTML Input | Image Input
|
|
146
|
-
| ----------- | ------------------ | ---------------------------------------------- |
|
|
147
|
-
| `png` | `Uint8Array` | Skia render → PNG encode | Decodes and converts to PNG
|
|
148
|
-
| `jpeg` | `Uint8Array` | Skia render → JPEG encode (`quality`) | Decodes and compresses JPEG
|
|
149
|
-
| `webp` | `Uint8Array` | Skia render → WebP encode (`quality`) | Decodes and compresses WebP
|
|
150
|
-
| `avif` | `Uint8Array` | Skia render → AVIF encode (`quality`, `speed`) | Decodes and compresses AVIF
|
|
151
|
-
| `raw` | `Uint8Array` | Uncompressed RGBA pixel bytes | Uncompressed RGBA pixel bytes
|
|
152
|
-
| `thumbhash` | `Uint8Array` | Computes ThumbHash from render | Computes ThumbHash from image
|
|
153
|
-
| `svg` | `string` | Skia vector drawing stream | Single `<image>` wrapper SVG
|
|
154
|
-
| `pdf` | `Uint8Array` | SkPDFDocument vector PDF | Single-page centered PDF
|
|
155
|
-
| `none` | `Uint8Array` | N/A (throws error) | Passthrough original bytes + extract metadata |
|
|
146
|
+
| Format | `result.data` Type | HTML Input | Image Input |
|
|
147
|
+
| ----------- | ------------------ | ---------------------------------------------- | ----------------------------- |
|
|
148
|
+
| `png` | `Uint8Array` | Skia render → PNG encode | Decodes and converts to PNG |
|
|
149
|
+
| `jpeg` | `Uint8Array` | Skia render → JPEG encode (`quality`) | Decodes and compresses JPEG |
|
|
150
|
+
| `webp` | `Uint8Array` | Skia render → WebP encode (`quality`) | Decodes and compresses WebP |
|
|
151
|
+
| `avif` | `Uint8Array` | Skia render → AVIF encode (`quality`, `speed`) | Decodes and compresses AVIF |
|
|
152
|
+
| `raw` | `Uint8Array` | Uncompressed RGBA pixel bytes | Uncompressed RGBA pixel bytes |
|
|
153
|
+
| `thumbhash` | `Uint8Array` | Computes ThumbHash from render | Computes ThumbHash from image |
|
|
154
|
+
| `svg` | `string` | Skia vector drawing stream | Single `<image>` wrapper SVG |
|
|
155
|
+
| `pdf` | `Uint8Array` | SkPDFDocument vector PDF | Single-page centered PDF |
|
|
156
156
|
|
|
157
157
|
---
|
|
158
158
|
|
|
@@ -269,17 +269,18 @@ npx wasm-html-to-image photo.jpg -o photo.avif -w 800 -f avif -q 80
|
|
|
269
269
|
|
|
270
270
|
---
|
|
271
271
|
|
|
272
|
-
## 📖 Documentation
|
|
272
|
+
## 📖 Documentation & Examples
|
|
273
273
|
|
|
274
274
|
For full guides, architecture deep-dives, font management, and advanced recipes:
|
|
275
275
|
|
|
276
|
-
👉 **[Read the Official Documentation](https://sorakumo001.github.io/wasm-html-to-image/)**
|
|
276
|
+
👉 **[Read the Official Documentation](https://sorakumo001.github.io/wasm-html-to-image/master/docs/)**
|
|
277
|
+
👉 **[Sample Code & Projects (GitHub)](https://github.com/SoraKumo001/wasm-html-to-image-samples)**
|
|
277
278
|
|
|
278
|
-
- [Overview & Getting Started](https://sorakumo001.github.io/wasm-html-to-image/docs/overview)
|
|
279
|
-
- [Architecture & Pipelines](https://sorakumo001.github.io/wasm-html-to-image/docs/architecture)
|
|
280
|
-
- [API Reference](https://sorakumo001.github.io/wasm-html-to-image/docs/api-reference)
|
|
281
|
-
- [Runtime Guide (Node / Workers / Edge / Browser)](https://sorakumo001.github.io/wasm-html-to-image/docs/api-reference/runtime-guide)
|
|
282
|
-
- [Production Recipes](https://sorakumo001.github.io/wasm-html-to-image/docs/recipes)
|
|
279
|
+
- [Overview & Getting Started](https://sorakumo001.github.io/wasm-html-to-image/master/docs/docs/overview)
|
|
280
|
+
- [Architecture & Pipelines](https://sorakumo001.github.io/wasm-html-to-image/master/docs/docs/architecture)
|
|
281
|
+
- [API Reference](https://sorakumo001.github.io/wasm-html-to-image/master/docs/docs/api-reference)
|
|
282
|
+
- [Runtime Guide (Node / Workers / Edge / Browser)](https://sorakumo001.github.io/wasm-html-to-image/master/docs/docs/api-reference/runtime-guide)
|
|
283
|
+
- [Production Recipes](https://sorakumo001.github.io/wasm-html-to-image/master/docs/docs/recipes/ogp-production)
|
|
283
284
|
|
|
284
285
|
---
|
|
285
286
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wasm-html-to-image",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "HTML to image converter on a single unified WASM module",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/single.js",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"url": "git+https://github.com/SoraKumo001/wasm-html-to-image.git",
|
|
15
15
|
"directory": "packages/html-to-image"
|
|
16
16
|
},
|
|
17
|
-
"homepage": "https://sorakumo001.github.io/wasm-html-to-image/",
|
|
17
|
+
"homepage": "https://sorakumo001.github.io/wasm-html-to-image/master/docs/",
|
|
18
18
|
"bugs": {
|
|
19
19
|
"url": "https://github.com/SoraKumo001/wasm-html-to-image/issues"
|
|
20
20
|
},
|