Skip to content

Releases

v2.6.0

Choose a tag to compare

@github-actions github-actions released this 02 Dec 18:29
e9fd6f2

Minor Changes

  • e6012a0: read, inspect and importDataset now report relationships to targets outside the file (JSE-85), failing closed. Every relationship in any relationships part of the package (root, workbook, sheets, drawings, charts, external links, any other) that is not a hyperlink and that is external (TargetMode="External", any letter case), whatever its kind, gives one UNSUPPORTED_PART warning with the new partKind 'externalTarget'. Example: a linked picture, an image relationship of a drawing with an http(s), UNC (\\host\share\…) or file: target, which Excel fetches when the file is opened (a tracking beacon; a UNC target can send the user's NTLM credentials to that host). Before, nothing reported it. Relationships already reported as another kind are reported here too: a linked OLE object gives 'oleObject' and 'externalTarget', an external link 'externalLink' and, for its path, 'externalTarget'. Also reported, while the model still reads the target as a part name as before:

    • a TargetMode that is neither Internal nor External (" External", "1", "", …);
    • a second, namespace-prefixed or differently cased TargetMode;
    • an internal target, or a second, prefixed or differently cased Target attribute, that starts with a URI scheme (after leading whitespace) or //, or contains a backslash.

    Hyperlinks are never reported. The warning's part is the first relationships part that holds one, parts lists every such relationships part once (bounded by maxEntries), and the new relationshipTypes field gives the first 16 distinct relationship types, excerpted. Targets are never included, resolved or fetched, and any number of such relationships is one warning. No new refusals: files that read in 2.5.0 still read, with at most this one more warning. ExcelPartKind gains 'externalTarget' (a switch over it needs a default branch, as documented) and ExcelWarning gains the optional relationshipTypes. Files this library writes have none: their hyperlinks are not reported.

v2.5.0

Choose a tag to compare

@github-actions github-actions released this 02 Dec 15:27
997a447

Minor Changes

  • ad9bfee: readCsv can now tell whether an upload is text, within limits. All new options are off by default, so files 2.4 read are read the same way.

    • rejectBinary: true scans the decoded text once, before any record is parsed, and refuses a control character that text files do not contain with FormatError CSV_BINARY_INPUT (details: { offset, byteOffset?, codePoint, encoding? }, never file text). Refused: U+0000–U+0008, U+000E–U+001A, U+001C–U+001F and DEL; TAB, LF, CR, VT, FF and ESC are allowed. U+0080–U+009F are refused only in text decoded as Windows-1252, where they come from its undefined bytes. A PNG, PDF or zip renamed .csv is refused at its first control byte.
    • encoding: 'auto': a UTF-8 or UTF-16 BOM still wins; otherwise strict UTF-8, then strict Windows-1252 (0x81, 0x8D, 0x8F, 0x90 and 0x9D are not text). Bytes that are neither, or invalid after their BOM, throw FormatError CSV_INVALID_ENCODING (details: { encodings, byteOffset? }) instead of being replaced. UTF-16 without a BOM is not guessed.
    • The result has a new encoding field for byte input: the encoding used, by its WHATWG name ('utf-8', 'utf-16le', 'utf-16be', 'windows-1252', …). importDataset reports the one 'auto' chose in meta.encoding.
    • maxInputBytes refuses larger binary input with the same LimitError as ReadLimits.maxInputBytes for xlsx, and is validated the same way (a positive number; null is a TypeError); a Blob is checked by its size before it is read. It does not apply to string input. importDataset applies limits.maxInputBytes to CSV when it is given (CSV stays unlimited by default).
    • keepRows: false (also for parseCsv) parses and checks every record, with the same limits, strict mode and warnings, but keeps none, so a check of a large upload holds only its bytes, its text and one record.
    • importDataset takes rejectBinary for CSV input, and the worker client's parseCsv passes the new options through. With limits.maxInputBytes given, importDataset checks a Blob's size before reading it, for every format. For uploads that must be CSV, pass format: 'csv': with format detection a zip or xlsx input is read as a workbook and does not go through rejectBinary, which only checks that the input decodes to text (HTML, script or polyglot content passes).
    • readCsv results for byte input gain an encoding key, so deep-equal comparisons of a whole result (toEqual) see one more key.
    • ExcelErrorCode gains CSV_BINARY_INPUT and CSV_INVALID_ENCODING: an exhaustive switch with a never default needs the two new cases.
  • 39e324a: New inspect(input, { limits, signal }) in javascript-excel/read checks an .xlsx, .xlsm, .xltx or .xltm file part by part without building its cells, for servers and browsers that must accept or refuse an upload without reading it into the model. Under the same limits it refuses every file read refuses, with the same error class, code and details (zip and reader limits, encryption, CFB and other formats, NOT_XLSX, XML_DTD_FORBIDDEN, malformed XML in the parts read parses, every sheet to its last row), and it returns read's UNSUPPORTED_PART warnings with their partKinds (VBA, macro sheets, external links, connections, OLE objects, query tables, …), the format, the worksheets with their cell counts (as maxCells counts them) and used ranges, and the counts of parts, inflated bytes, cells and shared strings. It also inflates every part read never opens (zip limits and CRC-32 apply) and searches its bytes for <!DOCTYPE (ASCII-compatible, UTF-16 and UTF-32 forms, whatever the part's name or content type, so a declaration inside an XML comment or an embedded file is refused too), and it refuses an XML part, including the parts read parses, whose byte order mark, first bytes or complete XML declaration show any encoding but UTF-8 or UTF-16, whose declaration does not follow the XMLDecl grammar, or that has a <?xml declaration anywhere but at its very start (XML_MALFORMED); so it can refuse files read accepts. Set maxItems with it: the styles table and the defined names are held, bounded by that limit. It keeps no cells, no shared strings and no more than 8 MiB of shared-formula text per sheet under any maxCellTextLength (a master's text waits only until a copy needs it; then a few numbers per master, and with a small limit per relative reference, all counted against maxItems): on a 19.8 MiB file of 3,420,000 cells its peak heap was about 30 MB, against about 410 MB for read, and it checks that file with the old generation limited to 32 MB. read is unchanged.

  • 170129d: read (and importDataset, which passes read warnings on) now walks the whole relationship graph of the package and reports more content it does not read as UNSUPPORTED_PART, with six new partKind values: 'activeX' (ActiveX controls), 'embeddedPackage' (a package relationship, such as a .docx embedded under xl/embeddings/), 'customUI' (a ribbon customisation: the root ui/extensibility relationship of Office 2007 or 2010), 'webExtension' (Office web add-ins), 'invalidPartName' (a zip entry name, relationship target or Override PartName OPC forbids: %2F or %5C in a segment, a percent-encoded dot segment, a segment ending in a dot, a target naming a relationships part or [Content_Types].xml, a target or PartName over 196,605 characters, which is not resolved; or a <Relationship> without Id or Target, which the model still ignores) and 'unreferencedPart' (a part no relationship reaches, such as a vbaProject.bin or an executable placed in the zip). The last two come as one warning each, with every name in a new parts field on the warning (bounded by maxEntries). Nothing is exempt by name: discarded parts Office 2007/2010 left under [trash]/ are reported too; a consumer that accepts them can check that every name in parts starts with [trash]/. The scan also finds 'oleObject', 'vbaProject' (now also attached toolbars and VBA signatures), 'externalLink', 'connections', 'queryTable' and 'macrosheet' where they were not reported before: under a drawing, under a table, or on a sheet left out by the sheets option. Excel 4 macro sheets with Microsoft's xlMacrosheet and xlIntlMacrosheet relationship types are now reported as 'macrosheet'. Relationship types are compared case-insensitively, and a part with the content type of an ActiveX control, OLE object, VBA project, macro sheet, web add-in or embedded Office file (documents, templates, add-ins, slides) is reported as that kind whatever relationship reaches it; equivalent Overrides in [Content_Types].xml are all checked. Drawings, images, comments and the other passive kinds are reported as before. Every relationships part in the zip is classified, also one whose owner nothing reaches. The scan reads only relationships parts, within the existing zip and XML limits, never inflates the parts it reports, and consults the signal throughout; a relationships part that is not well-formed XML is reported as unreferenced instead of failing the read. Existing warnings keep their shape; a switch over ExcelPartKind needs a default branch, as documented. The test corpus (files from LibreOffice and openpyxl, and every file of the conformance corpus this library writes) gives no new warnings.

    Behaviour changes against 2.4.0: part names are compared in OPC canonical form (percent-escapes decoded once, as UTF-8, on both sides; %2F, %5C, %25 and invalid bytes kept encoded), so percent-encoded zip entry names are now found where 2.4.0 reported MISSING_PART or NOT_XLSX, while a target matched to an entry only because 2.4.0 decoded the target and not the entry name (a literal % spelled differently on the two sides) no longer matches. Two zip entries with equivalent names (for example a b and a%20b) now throw ZIP_INVALID, as names that differ only in case already did. Because the scan parses every relationships part in the zip, a DTD or an over-deep XML in one of them (also under a sheet that is not read, or in an orphan relationships part) now throws XML_DTD_FORBIDDEN or LIMIT_EXCEEDED; 2.4.0 read such a file. A relationship target or Override PartName longer than 196,605 characters is not resolved and is reported as 'invalidPartName'; the length is checked before dot segments are resolved, so a part reachable only through such a padded target (for example 200 KB of ./ before worksheets/sheet1.xml) is now missing for read, where 2.4.0 read it.

v2.4.0

Choose a tag to compare

@github-actions github-actions released this 01 Dec 23:26
c6c5479

Minor Changes

  • 30d8fdb: Behaviour correction for the 'day' column type (importDataset, coerceColumns): 'day' now takes the day as written for ISO text with an explicit offset or Z; 2.3.0 took the day of the instant in dateZone. With dateZone: 'utc', 2026-10-31T00:00:00+01:00, 2026-10-31T00:30:00+02:00 and 2026-10-31 00:00:00+01:00 were 2026-10-30 and 2026-10-31T23:30:00-05:00 was 2026-11-01; all four are now 2026-10-31, at 00:00 of that day in dateZone, so a midnight reading with an offset no longer lands on the day before. This applies to every offset form the ISO parser accepts (T or space, optional seconds and fraction, Z, ±hh:mm, ±hhmm), in CSV fields and xlsx text cells. 'date' and 'datetime' are unchanged and keep the instant; text without an offset, Date values (including xlsx date cells), dates: 'serial', two-digit years and time-only cells are unchanged, and text the parser refuses is still null with a TYPE issue.

  • 104631c: A wide sheet can no longer make an import run out of memory. A new read limit, maxColumns, bounds the highest column any kept cell uses on each sheet read, checked as each cell is kept (not from <dimension>), and refuses a wider sheet with LimitError (details: { limit: 'maxColumns', value, max, part, ref }) at its first cell past the limit. Its default is Excel's own width, 16,384 (XFD), so no valid sheet is refused; servers and browsers reading untrusted files should set it low, for example 256. It applies to read, importDataset (limits.maxColumns, for xlsx and CSV) and the worker client, and parseCsv/readCsv take maxColumns as a CSV option for the fields of one record (default 1,048,576, wider than any spreadsheet).

    importDataset now counts the empty fields its dataset pads short rows with (a null for every column a row has no cell in) against limits.maxCells, for xlsx and CSV, before any row is built, and rejects past it with LimitError (details: { limit: 'maxCells', value, max, rows, columns }). Before, a 614 KB file with a title in each of 16,384 columns over 10,000 three-cell rows held only about 46,000 cells, so maxCells never tripped, and importDataset built 164 million fields and exhausted a 4 GB heap; under the default limits it is now refused in about 0.6 s. Cells with a value or formula are not counted, so dense data within the limits imports exactly as before; a cell that only carries a hyperlink or a style counts as an empty field.

    Other differences from 2.3: the dataset count is checked while the dataset is built, so it can win over errors 2.3 raised later for the same input (a types key naming no column, maxRows). CSV imports are counted too: more than 500,000 rows of 10 fields under a 30-column header pad more than 10 M empty fields (20 per row) and are refused under the defaults (raise maxCells). CSV imports now validate limits.maxCells (a bad value throws TypeError, where 2.3 ignored it), and spreading DEFAULT_READ_LIMITS into a CSV import passes maxColumns: 16384, so a wider record is a LimitError instead of 2.3's ValidationError. The public toDataset is not bounded by the dataset count; when calling it on untrusted sheets, set maxColumns on the read. A caller reading untrusted files should also lower maxItems (default 10,000,000), because hyperlink cells are built by the read before the dataset count can refuse them (measured: 5.1 million hyperlink cells in an 11.4 MB file reached about 1.7 GB before the refusal).

  • 880fa4f: Shared formulas no longer multiply a small file into minutes of work and gigabytes of memory. In read, a master formula longer than 8,192 characters (Excel's own formula limit) is no longer expanded into the cells that share it: they keep their cached values, with SHARED_FORMULA_UNRESOLVED naming the master cell and its length. Before, a 3 KB file with a 1,048,576-character master shared by 100 cells took 15 s and 3.1 GB, and with 1,000 cells ran out of memory; it now reads in about 0.1 s. A shifted copy longer than maxCellTextLength is not built either: that cell keeps its cached value with the same warning (saying the copy's length) and the read goes on, so no text longer than the limit is produced and a file 2.3.0 read is not refused. Shifting scans the master once, by character code, and builds each copy once as a flat string, so 1,000 × 100 cells sharing a 999-character formula read with formulas in about 1.3 s and 240 MB instead of 5.4 s and 1.9 GB.

    importDataset uses cell values, so it no longer shifts shared formulas at all: the cells that share one carry the master's text, which tells the same as each shifted copy whether a cell has a formula and whether the totals row is SUBTOTAL(…) (skipTotals: 'auto'). Its results are the same as 2.3.0's for every file, including masters longer than 8,192 characters. The 1,000 × 100 file above imports in 0.35 s and 140 MB instead of 5.4 s and 1.9 GB, and 10,000 × 90 such cells in 2.4 s instead of no result after 10 minutes.

    Still not covered by the limits: a full read with formulas on is bounded only by maxCells times the length of a copy (at most maxCellTextLength), so set formulas: false when the formula text is not needed; long header titles as row keys and worker copies are also still open.

v2.3.0

Choose a tag to compare

@github-actions github-actions released this 01 Dec 18:25
ba24874

Minor Changes

  • 392f85b: One cell's text, each other text the reader keeps, every message and the importDataset issue list are now bounded. A new read limit, maxCellTextLength (default 1,048,576 characters, 32 times Excel's own 32,767-character cell limit), refuses a shared string, inline string, <v> or formula text that is longer, with LimitError (details.limit: 'maxCellTextLength'), while the text streams in. The same limit applies to header and footer text, defined-name formulas and document property values (Excel's own limits there are 255 and 8,192). A document property (core, extended or custom) longer than the limit fails the whole read with LimitError, where broken XML in those optional parts only warns. It applies to read, readSheetNames (defined names), importDataset (limits.maxCellTextLength, for xlsx and CSV) and the worker client, and parseCsv/readCsv take it as a CSV option alongside maxFieldBytes. Before, a 305 KB file with one 16,000,000-character shared string read under every limit, and maxXmlTokenLength (whose documentation now says so) never limited text.

    Messages now quote an excerpt of long file and cell text instead of all of it: text over 128 characters becomes its first 64 characters, … and its length, in importDataset issues (TYPE, DATE_ORDER_AMBIGUOUS, ERROR_CELL), reader warnings that quote file text (INVALID_CELL_REF, INVALID_SHARED_STRING, ROWS_TRUNCATED, MISSING_PART, BROKEN_OPTIONAL_PART, HYPERLINK_RANGE_REDUCED, CELL_OUT_OF_BOUNDS) and XML and zip errors. Codes and fields (ref, sheet, part, column, details) are unchanged, and messages of 128 characters or less are as before. With the limit raised, 10,000 rows sharing a 16,000,000-character date cell used to exhaust a 4 GB heap through their TYPE messages; they now import in about 0.2 s with messages of at most 112 characters.

    importDataset has a new option, maxIssues (default 100,000; Infinity for no cap): past it, issues are counted in meta.droppedIssues ({ total, byCode }) instead of kept, except the first issue of each code, so every kind of issue, and an error whenever one occurred, is still listed. This also fixes a crash: with 500,000 bad cells 2.2.0 threw RangeError: Maximum call stack size exceeded.

    Not covered by these limits: work and memory multiplied by references, such as one long shared string used by many cells, shared formulas, long header titles as row keys and worker copies. A shared formula shifted for a cell can be about 1.7 times maxCellTextLength, and a hyperlink target with a location is kept as target, # and location from two attributes, so it can reach twice maxXmlTokenLength. The security section of the docs now gives settings for servers reading untrusted files (tighter limits, and a worker thread with a memory limit and a timeout).

  • bc10979: importDataset and coerceColumns: a new column type 'day' for calendar-day fields. Forced by types or a schema field's type, it converts like 'date' and drops the time of day, giving 00:00 of the day in dateZone, so toCsv with dates: 'iso' and the same dateZone writes YYYY-MM-DD. A time-only xlsx cell (1900 system) is not a day: null with a TYPE issue. 'date' is unchanged. ColumnType, and so ImportedColumn.type, can now be 'day': an exhaustive switch or Record over ColumnType needs a case for it.

  • fb8cb34: Import: new ImportLocale.twoDigitYearPivot (and parseDate's twoDigitYearPivot option) accepts numeric text dates with a two-digit year, such as 31.10.26 with dateOrder: 'DMY' or 10/31/26 with 'MDY', for CSV fields and xlsx text cells. A year yy below the pivot is 20yy, the rest 19yy; 30 is Excel's rule. Off by default, so nothing changes without it; 'YMD' and dateOrder: 'auto' never read two-digit years (an 'auto' column with them stays text with a DATE_ORDER_AMBIGUOUS issue).

v2.2.0

Choose a tag to compare

@github-actions github-actions released this 01 Dec 09:24
7a5ffd7

Minor Changes

  • 15f396d: read and readSheetNames no longer take minutes on a workbook that declares a very large number of sheets (80,000 entries in a 1 MB file blocked for 26 s): the sheet list, hyperlink relationships and overlapping column ranges are now read in linear time, the abort signal is checked throughout, and a new limit, maxSheets (default 10,000), refuses a workbook that declares more sheets with LimitError while its workbook part is parsed.

    New limit maxItems (default 10,000,000) counts what a read builds besides cells: column and row properties, merges, hyperlinks, selections, defined names, style records, custom properties and rich-text runs, across all sheets. Without it, many sheet entries naming one small part, or one column definition spanning every column, could build gigabytes. A workbook that builds more such items than the limit is now refused with LimitError (details.limit: 'maxItems'); raise it with limits: { maxItems: ... }. maxCells still counts only cells, as before.

v2.1.0

Choose a tag to compare

@github-actions github-actions released this 30 Nov 23:45
e7fef2e

Minor Changes

  • a854e61: CSV: new delimiterCandidates read option (parseCsv, readCsv, the worker's parseCsv and importDataset) sets which delimiters delimiter: 'auto' chooses from and in which order; when the file does not separate them, the first listed one wins, so [';', ',', '\t'] keeps a one-column file with decimal commas in one column.
  • f4f75e1: read has a new opt-in option, rawText: true, which adds cell.rawText to number and ISO-date cells: the <v> text exactly as stored in the file (for example 50.30, 1E-7 or 1234567890123456789), while value and type stay as before. Without the option the result is unchanged.
  • 2568125: Warnings: the warning cap no longer drops data-loss warnings (isDataLossWarning, new; for example CSV_UNTERMINATED_QUOTE, CSV_ROWS_TRUNCATED, ROWS_TRUNCATED, INVALID_SHARED_STRING, MISSING_PART, UNSUPPORTED_PART); past maxWarnings only informational warnings are dropped, the first 100 of each data-loss code are kept, and WARNINGS_TRUNCATED counts what was dropped in a new dropped field. parseCsv, readCsv, the worker's parseCsv and importDataset take maxWarnings (default 1,000). MISSING_PART, BROKEN_OPTIONAL_PART and UNSUPPORTED_PART carry a new partKind naming the kind of part.
    Changed past the cap: for read, WARNINGS_TRUNCATED stays where the first warning was dropped, but data-loss warnings can now follow it, so it is not necessarily the last warning and warnings.length can exceed maxWarnings + 1 (by up to 100 per data-loss code); 50 invalid cell references read with maxWarnings: 10 gave 11 warnings and now give all 50. For CSV it stays last. Under the cap, results are unchanged apart from partKind.
  • c09d98b: read no longer takes minutes on a file with one very long XML tag or comment (a single attribute value of tens of megabytes took over 3 minutes of CPU): such tokens are now read in linear time, and a new limit, maxXmlTokenLength (default 16 Mi characters, far above any real workbook), refuses a longer tag, comment, CDATA section or processing instruction with LimitError while it is read.

v2.0.0

Choose a tag to compare

@github-actions github-actions released this 19 Nov 21:34
63a67be

2.0 is a from-scratch rewrite. It reads and writes .xlsx and .csv in browsers, Web Workers and Node.js, in TypeScript, with no runtime dependencies.

Breaking changes from 1.x

1.0.3 exported a single default function, downloadExcel(), that zipped a placeholder text file with jszip and saved it with file-saver. None of that API remains:

  • The default export is gone. There is no default export; use the named exports of the entry points (javascript-excel, /read, /csv, /dom, /worker, /format, /render, /import). To save a file in the browser, build a workbook, then call toBlob or toUint8Array and download from javascript-excel/dom.
  • No runtime dependencies. jszip and file-saver are no longer installed with the package. The zip codec is built in, on the native CompressionStream/DecompressionStream.
  • ESM and CommonJS builds with types, from exports. The old lib/ paths (lib/javascript-excel.js, lib/index.js) are gone; deep imports outside the documented entry points are not supported.
  • Runtimes: Node.js 22 or later, and current browsers with CompressionStream (engines.node is >=22). Consumer TypeScript 5.0 or later.
  • File I/O is async. Writers and readers return promises.

The full API is in docs/api.md. Prereleases 2.0.0-alpha.1 to 2.0.0-beta.1 stay on the next dist-tag; their entries below are folded into this section.

Minor Changes

  • 6a8ee72: Add javascript-excel/csv: parseCsv, readCsv, toCsv and toCsvBlob. RFC 4180 parsing with delimiter detection, BOM and CRLF/LF/CR handling, lenient or strict modes, optional type inference, and an async readCsv with encoding detection and AbortSignal support. Serialization with quoting, BOM, ISO dates and a formula-injection guard that is on by default.

  • 8e8348f: Add the dataset builders:

    • fromDataset({ columns, data }, options): key, path and function accessors; header groups as merged header cells; falsy (conditional) columns skipped; per-column type coercion, numFmt, width (including 'auto'), hidden and styles.
    • Freeze and autofilter on the header rows, and a totals row with SUBTOTAL formulas whose cached values are computed from the data.
    • fromDatasets stacks several blocks on one sheet.
    • toDataset(sheet) reads a sheet back into { columns, data } with null-prototype rows.
  • 252a056: fromDatasets blocks take an optional placement: 'below' | 'right'. 'below' (the default) is the existing behaviour. 'right' puts a block on the previous block's top row, gap empty columns after its last column, with offset.cols and offset.rows adding to that. A 'below' block after 'right' blocks starts below the lowest of them, so blocks do not overlap. Existing calls give the same output as before.

  • 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 turns colspan/rowspan into merges (including rowspan="0"). It understands data-type, data-value and data-numfmt hints, and skips hidden and data-export-ignore rows and cells.
    • In a cell, <br> becomes a newline with wrapping, and the first link becomes the cell's hyperlink, limited to http, https and mailto unless hyperlinkSchemes allows 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 onWarning for 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_DROPPED warning code and the AutoWidthOptions type.

  • 4669375: New entry javascript-excel/import turns a user's .xlsx or .csv file into { columns, data } with importDataset. It handles:

    • the format, detected from the bytes
    • the sheet: the first visible one, or one picked by name or index
    • the header row, detected (title rows skipped, multi-row headers flattened)
    • column types, inferred all-or-nothing, with explicit number and date locales
    • column mapping to a schema by name or alias
    • per-row issues with their cell refs, and maxRows / preview

    The building blocks are exported too: detectHeader, inferColumnTypes, coerceColumns, parseNumber, parseDate, mapColumns and applyMapping.

    Other additions:

    • read gains maxRows. Rows past it are skipped without tokenizing them, while merges and sheet views are still read. It comes with a ROWS_TRUNCATED warning.
    • toDataset gains headerRows and join for multi-row headers.
    • The worker client gains importDataset.
    • New error codes: SHEET_NOT_FOUND, and VALIDATION_FAILED (reserved for react-data-import).
  • 07706d3: importDataset issues now name the field as it appears in data rows. With a schema, TYPE, ERROR_CELL and DATE_ORDER_AMBIGUOUS issues use the schema field name; they used the source column key. The new optional column property on ImportIssue holds the source column key (also set by coerceColumns and on applyMapping's REQUIRED). A value that doesn't convert to a forced type in a required field gives one TYPE issue, no longer a REQUIRED issue as well. Issues on columns the mapping drops are left out.

    Migration: if you grouped issues by the source column key, group by issue.column.

  • 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, DefinedName and the rest) are type-only, so they add no runtime code. Optional properties accept an explicit undefined, for projects using exactOptionalPropertyTypes. The errors are ExcelError, ValidationError, FormatError, LimitError, CsvError and EnvironmentError, with the ExcelErrorCode union and isExcelError, 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 native CompressionStream/DecompressionStream('deflate-raw'), with no runtime dependencies; the zip codec is not part of the public API.

  • 68d2df8: New entry javascript-excel/format: formatValue(value, numFmt, options) and formatCell(cell, options) render values the way Excel shows them in a cell. They cover number-format sections, conditions and colours, digit placeholders, grouping and scaling, percent, scientific, fractions, text, _x spacing and *x fills, General, dates and times from serials (time-zone free), elapsed time, built-in ids and locale tags. Separators, month and day names and the short date come from Intl for the given locale.

  • 7f50ecf: New entry javascript-excel/render: the render model a sheet viewer draws from. createRenderSheet(workbook, sheet, options) returns a handle with:

    • geometry: row and column offsets in pixels from prefix sums, plus hit testing;
    • cells: the merge map, concrete #RRGGBB styles cached per style object, resolved border edges, display text through an optional format hook (formatCell from /format fits), formula-bar text and hyperlink checks;
    • navigation: one-cell steps and Excel's Ctrl+arrow data edges;
    • copy: TSV/HTML builders and a selection summary.

    The core entry gains resolveColor, which resolves theme (with tint), indexed, RGB and automatic colours to ARGB.

  • 3fcf25b: javascript-excel/render: setRowHeights(sheet, heights) sets measured heights for rows without a stored height (a viewer's auto-fit). It grows rows only, clamped to 409 pt, and rebuilds the offsets from the first changed row. hasStoredRowHeight(sheet, row) tells which rows the file sized.

  • f0c9cf1: toDataset gains skipTotals: 'auto' | boolean. The default 'auto' drops a trailing row whose formulas are all SUBTOTAL(…), which is the totals row fromDataset writes. So toDataset(read(write(fromDataset(ds)))) no longer returns the totals as a data row. Pass skipTotals: false to keep it.

  • 6ce413a: importDataset and applyMapping: a schema field without a column is now null in every row, and columns lists every schema field. An unmapped field's column has an empty title and letter, type: 'empty', and its field. Rows always have the schema's shape, so validators such as Zod's .nullable() accept them; before this change the key was missing. A required field without a column still gives one MAPPING_MISSING issue, and is null in the rows.

  • e6a4a94: Add javascript-excel/worker: exposeWorker() for the app's two-line worker file and createWorkerClient(worker) with write, read, toCsv and parseCsv; progress, warnings and AbortSignal work across the boundary, results are transferred, errors keep their class and code. Performance: the shared strings table is written in chunks (no long main-thread block for large tables), CRC-32 uses slicing-by-8, and onProgress is throttled to one event per 50 ms.

  • bf744b1: Add javascript-excel/read: read, readSheetNames, detectFormat and DEFAULT_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 (z...

Read more

v2.0.0-beta.1

v2.0.0-beta.1 Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 17 Nov 15:44
67af07e

The conformance corpus was checked by hand in Excel for Mac (2026-11-17): every file opens with no repair prompt. The results are in docs/conformance.md. Excel for Windows and Apple Numbers were not checked by hand; for them only the automated LibreOffice and openpyxl checks apply. What changes for users:

  • Two-row headers without merges (CSV) are detected by header: 'auto', and a group title carries right over its sub-columns, so header groups written to CSV import back as Q1 / Jan, Q1 / Feb.
  • Built-in number formats 37–40 and 47 use the codes Excel shows, not the ECMA-376 ones. This affects BUILTIN_NUM_FMTS and the formatted text; written files are unchanged.
  • Sheet names are limited to 31 characters counted as Excel counts them (code points), so a name with an emoji at the limit is no longer rejected.

Patch Changes

  • c100c46: Built-in number formats 37–40 and 47 now use the codes Excel itself shows, checked in Excel for Mac: #,##0_);(#,##0), #,##0_);[Red](#,##0), #,##0.00_);(#,##0.00), #,##0.00_);[Red](#,##0.00) and mm:ss.0. The ECMA-376 table lists other codes. This changes BUILTIN_NUM_FMTS and what formatValue/formatCell show for those ids: positive numbers keep a trailing space where the ) would be (1,234.50 ), and 47 shows 31:00.0 instead of 3100.0. Files are unaffected, because the writer writes only the id.
  • 5020077: toDataset with headerRows (and importDataset with a multi-row header) now carries a group title right across the empty upper-row cells that follow it when there are no merges, as in CSV: Name,Q1, over ,Jan,Feb gives Name, Q1 / Jan, Q1 / Feb instead of Name, Q1 / Jan, Feb. Merged cells still decide where they are present, and a column with no text in the lower header rows is not filled.
  • 15f8238: Sheet names are limited to 31 code points, as in Excel, instead of 31 UTF-16 units. validateSheetName, the writer and sanitizeSheetName now accept a name such as 30 letters plus an emoji (Excel for Mac accepts it), and sanitizeSheetName cuts long names to 31 code points without splitting a surrogate pair. History stays reserved in any case (Excel refuses it), and sanitizeSheetName turns it into Sheet.
  • f7e976d: detectHeader (and importDataset with header: 'auto') now recognises a two-row header without merges, as CSV files have: a second all-text row whose text cells all sit on columns of typed data joins the header (Region,Sales,Sales over ,Q1,Q2 gives Sales / Q1, Sales / Q2). Two text rows that only fill the table together (Name,Q1, over ,Jan,Feb) are also a two-row header. When the row under the header is all text but only partly fits, it stays data and the confidence is 'low'.

v2.0.0-beta.0

v2.0.0-beta.0 Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 17 Nov 14:45
ee19d78

First beta of 2.0.0, on the next dist-tag. The 2.0.0 feature set is complete: everything in the 2.0.0-alpha releases below. Changes before 2.0.0 should be limited to fixes found in testing, including the manual conformance check in Excel and Numbers.

Patch Changes

v2.0.0-alpha.7

v2.0.0-alpha.7 Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 17 Nov 14:17
3a8bfc9

Minor Changes

  • 252a056: fromDatasets blocks take an optional placement: 'below' | 'right'. 'below' (the default) is the existing behaviour. 'right' puts a block on the previous block's top row, gap empty columns after its last column, with offset.cols and offset.rows adding to that. A 'below' block after 'right' blocks starts below the lowest of them, so blocks do not overlap. Existing calls give the same output as before.

Patch Changes

  • 938a6c6: read now returns to the event loop about every 16 ms while it parses, and feeds the decompressor in slices, so reading a large file on the main thread no longer freezes the page: frames render, timers and input run, and an abort from a timer or a click takes effect while the read is in flight. The resulting model is unchanged.
  • 33ba222: toUint8Array and toBlob now return to the event loop about every 16 ms while they write, so a large export on the main thread no longer freezes the page: frames render, timers and input run, and an abort from a timer or a click takes effect while the write is in flight. The output bytes are unchanged.