modern-xlsx API Reference - v1.3.0
    Preparing search index...

    Function writeBlob

    • Write a Workbook directly to a Blob for browser download. WASM must be initialized first via initWasm(). Only available in browser environments that support the Blob API.

      Parameters

      • wb: Workbook

        The Workbook to serialize.

      Returns Blob

      A Blob containing the XLSX file bytes.

      ModernXlsxError with code INVALID_WORKBOOK for the causes listed with that code in errors.ts, and IO_ERROR if the Blob cannot be constructed.

      const blob = writeBlob(wb);
      const url = URL.createObjectURL(blob);
      anchor.href = url;