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

    Function readBuffer

    • Read an XLSX file buffer and return a Workbook instance. WASM must be initialized first via initWasm().

      Data crosses the WASM boundary as a JSON string (serde_json in Rust, JSON.parse in JS).

      Parameters

      • data: Uint8Array

        Raw XLSX bytes (possibly encrypted OLE2 container).

      • Optionaloptions: ReadOptions

        Optional read options. Pass { password: '...' } for encrypted files and { limits: { ... } } to raise or tighten the security and size limits (see ReadLimits).

      Returns Promise<Workbook>

      A fully-parsed Workbook instance ready for reading/writing.

      import { initWasm, readBuffer } from 'modern-xlsx';

      await initWasm();
      const wb = await readBuffer(fileBytes);
      const ws = wb.getSheet('Sheet1');