Repository navigation
v2.0.0-alpha.1
Pre-releaseMinor Changes
-
6a8ee72: Add
javascript-excel/csv:parseCsv,readCsv,toCsvandtoCsvBlob. RFC 4180 parsing with delimiter detection, BOM and CRLF/LF/CR handling, lenient or strict modes, optional type inference, and an asyncreadCsvwith encoding detection and AbortSignal support. Serialization with quoting, BOM, ISO dates and a formula-injection guard that is on by default. -
9f81c95: Add
javascript-excel/dom:fromTable(table, options)turns an HTML<table>into a sheet. It reads the rows of<thead>, then<tbody>, then<tfoot>, and turnscolspan/rowspaninto merges (includingrowspan="0"). It understandsdata-type,data-valueanddata-numfmthints, and skips hidden anddata-export-ignorerows and cells.- In a cell,
<br>becomes a newline with wrapping, and the first link becomes the cell's hyperlink, limited tohttp,httpsandmailtounlesshyperlinkSchemesallows more. - Optional computed-style mapping covers bold, italic, underline, strike, colour, background (including a row's background) and explicit alignment. There are also header, freeze, autofilter and auto-width options, a per-cell hook, and
onWarningfor data that cannot be coerced or for dropped links. download(data, filename)saves bytes, a Blob or a string through a temporary<a download>and an object URL, with no dependencies. The module never touches globals at import.
Also adds the
HYPERLINK_DROPPEDwarning code and theAutoWidthOptionstype. -
6e84545: Add the workbook model types and typed errors to the core entry. The model types (
Workbook,Sheet,Cell,CellInput,CellValue,Style,Font,Fill,Border,Alignment,NumFmt,Color,Theme,SheetView,PrintSetup,ColumnProps,RowProps,DocProperties,DefinedNameand the rest) are type-only, so they add no runtime code. Optional properties accept an explicitundefined, for projects usingexactOptionalPropertyTypes. The errors areExcelError,ValidationError,FormatError,LimitError,CsvErrorandEnvironmentError, with theExcelErrorCodeunion andisExcelError, which also recognises errors from another ESM/CJS copy of the package or another realm. Internally, the package now has its own zip reader and writer built on the nativeCompressionStream/DecompressionStream('deflate-raw'), with no runtime dependencies; the zip codec is not part of the public API. -
bf744b1: Add
javascript-excel/read:read,readSheetNames,detectFormatandDEFAULT_READ_LIMITS. Reads .xlsx (and .xlsm, and ISO 29500 Strict) into the workbook model: values, shared/inline/rich strings, cached formula values and formula text with shared formulas expanded, styles as shared frozen objects, merges, column widths, row heights, freeze panes, views, print setup, hyperlinks, defined names, document properties and both date systems. Untrusted input is bounded by measured limits (zip sizes and ratio counted on inflated bytes, XML depth, cells, shared strings), and the streaming XML tokenizer rejects DOCTYPE. .xls, .xlsb, .ods and encrypted files are rejected with UNSUPPORTED_FORMAT. -
54d805b: Add the xlsx writer:
toUint8ArrayandtoBlob. It writes strings (shared or inline), numbers, booleans, dates (1900 and 1904 systems), error values, rich text, formulas with cached values and styled empty cells. It also writes the full style model: fonts, pattern and gradient fills, all border styles with a colour per side, alignment, protection, and built-in and custom number formats. Styles are layered sheet → column → row → cell and deduplicated. Sheet order, names, visibility, the active sheet, the default font and document properties are written too, and the model and options are validated with typed errors. Also addsdateToSerial,serialToDate,mergeStylesand the A1 address helpers, and exports the sharedBinaryInput,BlobType,AbortSignalLikeandExcelWarningtypes from the core entry. -
8ab2b97: The xlsx writer now writes sheet features:
- column widths (characters, pixels or the new
'auto'), column and row styles, row heights, hidden rows and columns, outline levels; - merges, autofilter, freeze panes and the sheet view (right-to-left, zoom, gridlines, selection), tab colours and default sizes;
- hyperlinks, external or internal. External URLs are limited to
http,httpsandmailtounlesshyperlinkSchemesallows more; - defined names, and print setup: orientation, paper size, fit to page, scale, margins, print area and titles, headers and footers.
These model fields are no longer ignored, and they are validated with the new
INVALID_SHEET_PROPERTYandINVALID_DEFINED_NAMEcodes. An invalid sheetstatenow reportsINVALID_SHEET_PROPERTYinstead ofINVALID_SHEET_NAME. This release also addscellText,validateSheetNameandsanitizeSheetName. - column widths (characters, pixels or the new
Patch Changes
- bc50cd3:
serialToDateaccepts serials from 0 to below 1 in the 1900 date system (Excel's day 0, used for time-only values such as 0.5 = 12:00) and returns them on 1899-12-31. It used to throwINVALID_DATE.