Streaming readers & writers

createWriteOnlyWorkbook, loadWorkbookStream, and the iter-based row APIs.

2 exports from 2 source files

Read only

src/streaming/read-only.ts

loadWorkbookStream function

src/streaming/read-only.ts:789

Open an xlsx for read-only streaming access.

Cell values match what loadWorkbook reports for the same bytes, rich text included. Where the two differ is in how much they tolerate: this reader reports a cell as empty for a t="s" index with no shared string behind it and for a t="b" value outside xsd:boolean, both of which loadWorkbook rejects. A pass over a sheet too large to model should not lose every row after one corrupt cell. A malformed number still throws, because a null there could not be told apart from an empty cell.

function loadWorkbookStream(source: XlsxSource, opts?: LoadWorkbookStreamOptions): Promise<ReadOnlyWorkbook>

Parameters

NameTypeDescription
source XlsxSource
opts? = {}LoadWorkbookStreamOptions

Returns

Promise<ReadOnlyWorkbook>

Write only

src/streaming/write-only.ts

createWriteOnlyWorkbook function

src/streaming/write-only.ts:424

Open a workbook for streaming write-only output.

function createWriteOnlyWorkbook(sink: XlsxSink, opts?: WriteOnlyOptions): Promise<WriteOnlyWorkbook>

Parameters

NameTypeDescription
sink XlsxSink
opts? = {}WriteOnlyOptions

Returns

Promise<WriteOnlyWorkbook>