xlsx-kit@0.5.0
Minor Changes
- #66
afecdc3Thanks @baseballyama! - Remove the silently-ignoredreadOnly/keepLinks/keepVba/dataOnly/richTextplaceholders fromLoadOptions. They were declared on the public surface but the loader (src/io/load.ts) accepted them via_optsand dropped them on the floor, so production callers expectingdataOnly: trueto suppress formulas — orreadOnly: trueto enable a special path — got the default behaviour instead.LoadOptionsis now an empty type until the underlying behaviour ships; future toggles will land here once they actually do something. TheloadWorkbook(source, opts)signature is unchanged.
Patch Changes
-
#64
b613607Thanks @baseballyama! - Treat sheet names as case-insensitive for uniqueness, matching Excel. PreviouslyaddWorksheet(wb, 'Data')followed byaddWorksheet(wb, 'data')succeeded locally but produced a workbook Excel and LibreOffice refuse to open.addWorksheet,addChartsheet,duplicateSheet,renameSheet, andpickUniqueSheetTitlenow compare titles case-insensitively. A case-only rename of the same sheet (renameSheet(wb, 'Data', 'data')) is allowed. -
#51
1cf8d0cThanks @baseballyama! - Tighten the streaming I/O surface so the README's "fixed-memory" claims hold up
in practice.toFile().toBytes().finish()no longer re-reads the just-written file. The
previous code calledfs.readFile(path)fromfinish()and returned the
full archive bytes, defeating the chunk-streamed write — a 10M-row workbook
ended its save by reloading the entire output into memory.finish()now
resolves with an emptyUint8Arrayonce the underlying write stream has
flushed; callers that need the bytes shouldfs.readFile()the path
themselves.toFileandtoWritablehonour write-stream backpressure: whenwrite()
returnsfalse, subsequent chunks chain off adrainevent before
proceeding, so peak memory tracks the writable'shighWaterMarkrather
than the producer's pace.workbookToBytesno longer depends onBuffer. Browser bundles that omit
the NodeBufferpolyfill previously broke attoBuffer().result()
because the in-memory sink ended its result withBuffer.from(...). The
helper now uses aUint8Array-only sink; a regression test
(tests/phase-1/io/browser.test.ts) saves a workbook withglobalThis.Buffer
shadowed toundefined.- The streaming read path inflates worksheet entries chunk-by-chunk. A new
ZipArchive.readStream(path)returns aReadableStream<Uint8Array>that
drives fflate'sInflateincrementally, andloadWorkbookStream's
whole-sheetiterRows()feeds the SAX parser directly off that stream so
the inflated worksheet body is never fully resident. Band queries
(minRow > 1) still materialise the inflated sheet to build the row-offset
index — that trade-off is unchanged. - Documentation: the
XlsxSink/BufferedSinkWriterJSDoc no longer
describestoBytes()as the "buffered mode" — that name was historical;
the underlying object can either accumulate (buffered sinks) or forward
chunks as they arrive (streaming sinks). The README also clarifies that
the streaming reader still loads the compressed archive up front (ZIP
needs random access to the central directory) — the win is that the
inflated worksheet payload is never fully resident.
-
#63
fa73fc5Thanks @baseballyama! - Tighten sheet-title validation on the streaming write path. ThecreateWriteOnlyWorkbookaddWorksheetcall now applies the same rules as the bufferedaddWorksheet(no: \ / ? * [ ], no leading / trailing apostrophe, not the reserved nameHistory) and rejects duplicate titles case-insensitively so the streaming path can't produce a workbook Excel refuses to open.