wasm-html-to-image 1.0.17 → 1.0.19
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/dist/cli.js +2 -2
- package/dist/core.d.ts +1 -1
- package/dist/html-to-image-wasm.js +3 -3
- package/dist/html-to-image.wasm +0 -0
- package/dist/js-page.d.ts +1 -1
- package/dist/js-page.js +37 -10
- package/dist/web-workers.js +1 -1
- package/package.json +5 -7
package/dist/cli.js
CHANGED
|
@@ -31,7 +31,7 @@ program
|
|
|
31
31
|
.option("-w, --width <number>", "viewport width", (v) => parseInt(v, 10), 800)
|
|
32
32
|
.option("-h, --height <number>", "viewport height (omit for auto)", (v) => parseInt(v, 10))
|
|
33
33
|
.option("-f, --format <format>", `output format (${OUTPUT_FORMATS.join(", ")}); default: from the --output extension, else png`)
|
|
34
|
-
.option("--font <path>", "local font file or glob such as './fonts/*.woff2' (repeatable); 'Family=path' registers it under that family name, e.g. 'Segoe UI=C:/Windows/Fonts/segoeui.ttf'", (v, prev = []) => [...prev, v])
|
|
34
|
+
.option("--font <path>", "local font file or glob such as './fonts/*.woff2' (repeatable); 'Family=path' registers it under that family name, e.g. 'Segoe UI=C:/Windows/Fonts/segoeui.ttf'; repeat a family for each weight, font-weight picks the nearest file", (v, prev = []) => [...prev, v])
|
|
35
35
|
.option("-q, --quality <number>", "encode quality 0-100 (encode stage only)", (v) => parseFloat(v), 85)
|
|
36
36
|
.option("--base-url <url>", "base URL for relative resources (URL input: defaults to the post-redirect document URL; file input: defaults to the file's directory)")
|
|
37
37
|
.option("--color-space <srgb|cmyk>", "output color space of tiff and pdf (default srgb; cmyk rewrites colors for print, with no ICC profile)", (v) => v.toLowerCase())
|
|
@@ -40,7 +40,7 @@ program
|
|
|
40
40
|
.option("--animation <duration-ms>", "sample the document's @keyframes opacity / transform / color animation into an animated WebP / APNG / GIF; one loop duration in ms (webp, apng and gif output only; the CSS animation-duration wins and this value is an upper bound)", (v) => parseInt(v, 10))
|
|
41
41
|
.option("--animation-fps <n>", "animation frame rate (default 15, capped at ~75 frames total; requires --animation)", (v) => parseInt(v, 10))
|
|
42
42
|
.option("--animation-loop <n>", "how many times the animated WebP / APNG / GIF repeats (0 = infinite, the default; 1 = play once; requires --animation)", (v) => parseInt(v, 10))
|
|
43
|
-
.option("--js", "run the page's scripts in jsdom before rendering (needs the optional
|
|
43
|
+
.option("--js", "run the page's scripts in jsdom before rendering (needs the optional dependency jsdom; trusted pages only)")
|
|
44
44
|
.option("--js-wait <ms|selector>", "with --js: milliseconds to wait after load (default 1000), or a CSS selector to wait for")
|
|
45
45
|
.action(async (input, options) => {
|
|
46
46
|
try {
|
package/dist/core.d.ts
CHANGED
|
@@ -78,7 +78,7 @@ export interface LayoutBox {
|
|
|
78
78
|
export interface HtmlToImageOptions extends RenderOptions {
|
|
79
79
|
/**
|
|
80
80
|
* Run the page's scripts before rendering (Node only; `single` entry point and the CLI's `--js`).
|
|
81
|
-
* The page is loaded into jsdom (optional
|
|
81
|
+
* The page is loaded into jsdom (optional dependency `jsdom`), its scripts run, and the resulting
|
|
82
82
|
* DOM is rendered. `true` waits for `load` plus 1 s; pass `{ timeout, settleMs, waitFor }` to tune it.
|
|
83
83
|
* jsdom has no layout and is not a security sandbox: only use it with pages you trust.
|
|
84
84
|
*/
|