• Freeze-dry an HTML Document.

    Technically, this function is a convenience wrapper that instantiates and runs a FreezeDryer instance. Use that class instead if you need more control; for example to access the incomplete result before freezeDry finishes, or to obtain it as a Document or Blob rather than a string.

    Example

    Simplest use case:

    const html = await freezeDry()
    

    With options:

    const html = await freezeDry(document, { timeout: 5000 })
    

    Returns

    The freeze-dried document as a self-contained, static HTML string.

    Parameters

    • document: Document = ...

      Document to be freeze-dried. Remains unmodified. Defaults to window.document.

    • options: Partial<FreezeDryConfig> = {}

      Options to customise freezeDry’s behaviour. See FreezeDryConfig.

    Returns Promise<string>