generateHtmlAsync
function generateHtmlAsync(params): Promise<HtmlOutput>;Defined in: src/html.ts:509
Generate a fully offline interactive HTML diagram from an ASL definition.
Identical to generateHtml — overlays included — except AWS service icons
are fetched once and inlined as base64 data URIs, so the document has no external
references even with showIcons: true. An icon shared by the expanded and collapsed
views is fetched once for both, and the embedded relayout model carries the same
data URIs, so a container collapsed in the browser re-renders offline too. When the
diagram has no remote icons this costs nothing — no icon is fetched and no network
request is made.
Parameters
Section titled “Parameters”params
Section titled “params”ASL definition plus the same options as generateSvg, and
optionally history and/or diff.
Returns
Section titled “Returns”Promise<HtmlOutput>
Promise resolving to the HTML document string plus dimensions and metadata.
Example
Section titled “Example”import { generateHtmlAsync } from 'sfn-diagram';import { writeFileSync } from 'node:fs';const { html } = await generateHtmlAsync({ aslDefinition: asl, showIcons: true });writeFileSync('diagram.html', html); // opens offline, icons included