MCPcopy
hub / github.com/bubkoo/html-to-image / toPng

Function toPng

src/index.ts:71–77  ·  view source on GitHub ↗
(
  node: T,
  options: Options = {},
)

Source from the content-addressed store, hash-verified

69}
70
71export async function toPng<T extends HTMLElement>(
72 node: T,
73 options: Options = {},
74): Promise<string> {
75 const canvas = await toCanvas(node, options)
76 return canvas.toDataURL()
77}
78
79export async function toJpeg<T extends HTMLElement>(
80 node: T,

Callers 5

special.spec.tsFile · 0.90
logDataUrlFunction · 0.90
renderAndCheckFunction · 0.90
recognizeImageFunction · 0.90
options.spec.tsFile · 0.90

Calls 1

toCanvasFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…