satoru-render 0.0.22 → 0.0.23
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 +13 -13
- package/dist/satoru-single.js +0 -0
- package/dist/satoru.wasm +0 -0
- package/dist/web-workers.js +1 -1
- package/dist/workers-dummy.d.ts +9 -0
- package/dist/workers-dummy.js +8 -0
- package/dist/workers-parent.js +682 -0
- package/dist/workers.d.ts +3 -0
- package/dist/workers.js +2 -0
- package/package.json +5 -2
- package/dist/bench.d.ts +0 -1
- package/dist/bench.js +0 -70
- package/dist/jsx.d.ts +0 -2
- package/dist/jsx.js +0 -2
- package/dist/satoru-single.wasm +0 -0
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Satoru Render: High-Performance HTML to Image/PDF Engine
|
|
2
2
|
|
|
3
|
-
[](https://sorakumo001.github.io/satoru/)
|
|
3
|
+
[](https://sorakumo001.github.io/satoru/master)
|
|
4
4
|
[](https://www.npmjs.com/package/satoru-render)
|
|
5
5
|
[](https://www.npmjs.com/package/satoru-render)
|
|
6
6
|
[](https://www.npmjs.com/package/satoru-render)
|
|
@@ -158,7 +158,7 @@ const png = await render({
|
|
|
158
158
|
console.warn(`Failed to fetch via proxy: ${resource.url}`, e);
|
|
159
159
|
}
|
|
160
160
|
}
|
|
161
|
-
|
|
161
|
+
|
|
162
162
|
// Fallback to default resolver for other resources
|
|
163
163
|
return defaultResolver(resource);
|
|
164
164
|
},
|
|
@@ -346,18 +346,18 @@ npx satoru-render input.html -f webp --verbose
|
|
|
346
346
|
|
|
347
347
|
### Render Options
|
|
348
348
|
|
|
349
|
-
| Option | Type
|
|
350
|
-
| :---------------- |
|
|
349
|
+
| Option | Type | Description |
|
|
350
|
+
| :---------------- | :----------------------------------------- | :------------------------------------------------------ |
|
|
351
351
|
| `value` | `string \| string[] \| HTMLElement \| ...` | HTML string, array of strings, or DOM element(s). |
|
|
352
|
-
| `url` | `string`
|
|
353
|
-
| `width` | `number`
|
|
354
|
-
| `height` | `number`
|
|
355
|
-
| `format` | `"svg" \| "png" \| "webp" \| "pdf"`
|
|
356
|
-
| `resolveResource` | `ResourceResolver`
|
|
357
|
-
| `fonts` | `Object[]`
|
|
358
|
-
| `css` | `string`
|
|
359
|
-
| `baseUrl` | `string`
|
|
360
|
-
| `logLevel` | `LogLevel`
|
|
352
|
+
| `url` | `string` | URL to fetch HTML from. |
|
|
353
|
+
| `width` | `number` | **Required.** Output width in pixels. |
|
|
354
|
+
| `height` | `number` | Output height. Default: `0` (auto-calculate). |
|
|
355
|
+
| `format` | `"svg" \| "png" \| "webp" \| "pdf"` | Output format. Default: `"svg"`. |
|
|
356
|
+
| `resolveResource` | `ResourceResolver` | Async callback to fetch assets (fonts, images, CSS). |
|
|
357
|
+
| `fonts` | `Object[]` | Pre-load fonts: `[{ name, data: Uint8Array }]`. |
|
|
358
|
+
| `css` | `string` | Extra CSS to inject into the document. |
|
|
359
|
+
| `baseUrl` | `string` | Base URL for relative path resolution. |
|
|
360
|
+
| `logLevel` | `LogLevel` | Verbosity: `None`, `Error`, `Warning`, `Info`, `Debug`. |
|
|
361
361
|
|
|
362
362
|
---
|
|
363
363
|
|
package/dist/satoru-single.js
CHANGED
|
Binary file
|
package/dist/satoru.wasm
CHANGED
|
Binary file
|