Streaming readers & writers
createWriteOnlyWorkbook, loadWorkbookStream, and the iter-based row APIs.
Read only
src/streaming/read-only.tsloadWorkbookStream function
src/streaming/read-only.ts:789Open 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
| Name | Type | Description |
|---|---|---|
source | XlsxSource | |
opts? = {} | LoadWorkbookStreamOptions |
Returns
Promise<ReadOnlyWorkbook>
Write only
src/streaming/write-only.tscreateWriteOnlyWorkbook function
src/streaming/write-only.ts:424Open a workbook for streaming write-only output.
function createWriteOnlyWorkbook(sink: XlsxSink, opts?: WriteOnlyOptions): Promise<WriteOnlyWorkbook>Parameters
| Name | Type | Description |
|---|---|---|
sink | XlsxSink | |
opts? = {} | WriteOnlyOptions |
Returns
Promise<WriteOnlyWorkbook>