Repository navigation
Releases
v2.6.0
Minor Changes
-
e6012a0:
read,inspectandimportDatasetnow 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 oneUNSUPPORTED_PARTwarning with the newpartKind'externalTarget'. Example: a linked picture, animagerelationship of a drawing with anhttp(s), UNC (\\host\share\…) orfile: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
TargetModethat is neitherInternalnorExternal(" External","1","", …); - a second, namespace-prefixed or differently cased
TargetMode; - an internal target, or a second, prefixed or differently cased
Targetattribute, that starts with a URI scheme (after leading whitespace) or//, or contains a backslash.
Hyperlinks are never reported. The warning's
partis the first relationships part that holds one,partslists every such relationships part once (bounded bymaxEntries), and the newrelationshipTypesfield 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.ExcelPartKindgains'externalTarget'(aswitchover it needs adefaultbranch, as documented) andExcelWarninggains the optionalrelationshipTypes. Files this library writes have none: their hyperlinks are not reported. - a
v2.5.0
Minor Changes
-
ad9bfee:
readCsvcan 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: truescans the decoded text once, before any record is parsed, and refuses a control character that text files do not contain withFormatErrorCSV_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.csvis 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, throwFormatErrorCSV_INVALID_ENCODING(details: { encodings, byteOffset? }) instead of being replaced. UTF-16 without a BOM is not guessed.- The result has a new
encodingfield for byte input: the encoding used, by its WHATWG name ('utf-8','utf-16le','utf-16be','windows-1252', …).importDatasetreports the one'auto'chose inmeta.encoding. maxInputBytesrefuses larger binary input with the sameLimitErrorasReadLimits.maxInputBytesfor xlsx, and is validated the same way (a positive number;nullis aTypeError); aBlobis checked by its size before it is read. It does not apply to string input.importDatasetapplieslimits.maxInputBytesto CSV when it is given (CSV stays unlimited by default).keepRows: false(also forparseCsv) 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.importDatasettakesrejectBinaryfor CSV input, and the worker client'sparseCsvpasses the new options through. Withlimits.maxInputBytesgiven,importDatasetchecks aBlob's size before reading it, for every format. For uploads that must be CSV, passformat: 'csv': with format detection a zip or xlsx input is read as a workbook and does not go throughrejectBinary, which only checks that the input decodes to text (HTML, script or polyglot content passes).readCsvresults for byte input gain anencodingkey, so deep-equal comparisons of a whole result (toEqual) see one more key.ExcelErrorCodegainsCSV_BINARY_INPUTandCSV_INVALID_ENCODING: an exhaustiveswitchwith aneverdefault needs the two new cases.
-
39e324a: New
inspect(input, { limits, signal })injavascript-excel/readchecks an.xlsx,.xlsm,.xltxor.xltmfile 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 filereadrefuses, 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 partsreadparses, every sheet to its last row), and it returnsread'sUNSUPPORTED_PARTwarnings with theirpartKinds(VBA, macro sheets, external links, connections, OLE objects, query tables, …), the format, the worksheets with their cell counts (asmaxCellscounts them) and used ranges, and the counts of parts, inflated bytes, cells and shared strings. It also inflates every partreadnever 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 partsreadparses, 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<?xmldeclaration anywhere but at its very start (XML_MALFORMED); so it can refuse filesreadaccepts. SetmaxItemswith 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 anymaxCellTextLength(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 againstmaxItems): on a 19.8 MiB file of 3,420,000 cells its peak heap was about 30 MB, against about 410 MB forread, and it checks that file with the old generation limited to 32 MB.readis unchanged. -
170129d:
read(andimportDataset, which passes read warnings on) now walks the whole relationship graph of the package and reports more content it does not read asUNSUPPORTED_PART, with six newpartKindvalues:'activeX'(ActiveX controls),'embeddedPackage'(apackagerelationship, such as a.docxembedded underxl/embeddings/),'customUI'(a ribbon customisation: the rootui/extensibilityrelationship of Office 2007 or 2010),'webExtension'(Office web add-ins),'invalidPartName'(a zip entry name, relationship target or Override PartName OPC forbids:%2For%5Cin 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>withoutIdorTarget, which the model still ignores) and'unreferencedPart'(a part no relationship reaches, such as avbaProject.binor an executable placed in the zip). The last two come as one warning each, with every name in a newpartsfield on the warning (bounded bymaxEntries). 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 inpartsstarts 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 thesheetsoption. Excel 4 macro sheets with Microsoft'sxlMacrosheetandxlIntlMacrosheetrelationship 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].xmlare 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; aswitchoverExcelPartKindneeds adefaultbranch, 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,%25and invalid bytes kept encoded), so percent-encoded zip entry names are now found where 2.4.0 reportedMISSING_PARTorNOT_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 examplea banda%20b) now throwZIP_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 throwsXML_DTD_FORBIDDENorLIMIT_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./beforeworksheets/sheet1.xml) is now missing forread, where 2.4.0 read it.
v2.4.0
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 orZ; 2.3.0 took the day of the instant indateZone. WithdateZone: 'utc',2026-10-31T00:00:00+01:00,2026-10-31T00:30:00+02:00and2026-10-31 00:00:00+01:00were 2026-10-30 and2026-10-31T23:30:00-05:00was 2026-11-01; all four are now 2026-10-31, at 00:00 of that day indateZone, so a midnight reading with an offset no longer lands on the day before. This applies to every offset form the ISO parser accepts (Tor 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,Datevalues (including xlsx date cells),dates: 'serial', two-digit years and time-only cells are unchanged, and text the parser refuses is stillnullwith aTYPEissue. -
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 withLimitError(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 toread,importDataset(limits.maxColumns, for xlsx and CSV) and the worker client, andparseCsv/readCsvtakemaxColumnsas a CSV option for the fields of one record (default 1,048,576, wider than any spreadsheet).importDatasetnow counts the empty fields its dataset pads short rows with (anullfor every column a row has no cell in) againstlimits.maxCells, for xlsx and CSV, before any row is built, and rejects past it withLimitError(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, somaxCellsnever tripped, andimportDatasetbuilt 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
typeskey 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 (raisemaxCells). CSV imports now validatelimits.maxCells(a bad value throwsTypeError, where 2.3 ignored it), and spreadingDEFAULT_READ_LIMITSinto a CSV import passesmaxColumns: 16384, so a wider record is aLimitErrorinstead of 2.3'sValidationError. The publictoDatasetis not bounded by the dataset count; when calling it on untrusted sheets, setmaxColumnson theread. A caller reading untrusted files should also lowermaxItems(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, withSHARED_FORMULA_UNRESOLVEDnaming 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 thanmaxCellTextLengthis 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.importDatasetuses 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 isSUBTOTAL(…)(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
readwith formulas on is bounded only bymaxCellstimes the length of a copy (at mostmaxCellTextLength), so setformulas: falsewhen the formula text is not needed; long header titles as row keys and worker copies are also still open.
v2.3.0
Minor Changes
-
392f85b: One cell's text, each other text the reader keeps, every message and the
importDatasetissue 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, withLimitError(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 withLimitError, where broken XML in those optional parts only warns. It applies toread,readSheetNames(defined names),importDataset(limits.maxCellTextLength, for xlsx and CSV) and the worker client, andparseCsv/readCsvtake it as a CSV option alongsidemaxFieldBytes. Before, a 305 KB file with one 16,000,000-character shared string read under every limit, andmaxXmlTokenLength(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, inimportDatasetissues (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.importDatasethas a new option,maxIssues(default 100,000;Infinityfor no cap): past it, issues are counted inmeta.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 threwRangeError: 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 twicemaxXmlTokenLength. 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:
importDatasetandcoerceColumns: a new column type'day'for calendar-day fields. Forced bytypesor a schema field'stype, it converts like'date'and drops the time of day, giving 00:00 of the day indateZone, sotoCsvwithdates: 'iso'and the samedateZonewritesYYYY-MM-DD. A time-only xlsx cell (1900 system) is not a day:nullwith aTYPEissue.'date'is unchanged.ColumnType, and soImportedColumn.type, can now be'day': an exhaustiveswitchorRecordoverColumnTypeneeds a case for it. -
fb8cb34: Import: new
ImportLocale.twoDigitYearPivot(andparseDate'stwoDigitYearPivotoption) accepts numeric text dates with a two-digit year, such as31.10.26withdateOrder: 'DMY'or10/31/26with'MDY', for CSV fields and xlsx text cells. A yearyybelow the pivot is20yy, the rest19yy;30is Excel's rule. Off by default, so nothing changes without it;'YMD'anddateOrder: 'auto'never read two-digit years (an 'auto' column with them stays text with aDATE_ORDER_AMBIGUOUSissue).
v2.2.0
Minor Changes
-
15f396d:
readandreadSheetNamesno 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 withLimitErrorwhile 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 withLimitError(details.limit: 'maxItems'); raise it withlimits: { maxItems: ... }.maxCellsstill counts only cells, as before.
v2.1.0
Minor Changes
- a854e61: CSV: new
delimiterCandidatesread option (parseCsv,readCsv, the worker'sparseCsvandimportDataset) sets which delimitersdelimiter: '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:
readhas a new opt-in option,rawText: true, which addscell.rawTextto number and ISO-date cells: the<v>text exactly as stored in the file (for example50.30,1E-7or1234567890123456789), whilevalueandtypestay as before. Without the option the result is unchanged. - 2568125: Warnings: the warning cap no longer drops data-loss warnings (
isDataLossWarning, new; for exampleCSV_UNTERMINATED_QUOTE,CSV_ROWS_TRUNCATED,ROWS_TRUNCATED,INVALID_SHARED_STRING,MISSING_PART,UNSUPPORTED_PART); pastmaxWarningsonly informational warnings are dropped, the first 100 of each data-loss code are kept, andWARNINGS_TRUNCATEDcounts what was dropped in a newdroppedfield.parseCsv,readCsv, the worker'sparseCsvandimportDatasettakemaxWarnings(default 1,000).MISSING_PART,BROKEN_OPTIONAL_PARTandUNSUPPORTED_PARTcarry a newpartKindnaming the kind of part.
Changed past the cap: forread,WARNINGS_TRUNCATEDstays where the first warning was dropped, but data-loss warnings can now follow it, so it is not necessarily the last warning andwarnings.lengthcan exceedmaxWarnings + 1(by up to 100 per data-loss code); 50 invalid cell references read withmaxWarnings: 10gave 11 warnings and now give all 50. For CSV it stays last. Under the cap, results are unchanged apart frompartKind. - c09d98b:
readno 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 withLimitErrorwhile it is read.
v2.0.0
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 calltoBlobortoUint8Arrayanddownloadfromjavascript-excel/dom. - No runtime dependencies.
jszipandfile-saverare no longer installed with the package. The zip codec is built in, on the nativeCompressionStream/DecompressionStream. - ESM and CommonJS builds with types, from
exports. The oldlib/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.nodeis>=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,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. -
8e8348f: Add the dataset builders:
fromDataset({ columns, data }, options):key,pathand function accessors; header groups as merged header cells; falsy (conditional) columns skipped; per-columntypecoercion,numFmt,width(including'auto'),hiddenand styles.- Freeze and autofilter on the header rows, and a totals row with
SUBTOTALformulas whose cached values are computed from the data. fromDatasetsstacks several blocks on one sheet.toDataset(sheet)reads a sheet back into{ columns, data }with null-prototype rows.
-
252a056:
fromDatasetsblocks take an optionalplacement: 'below' | 'right'.'below'(the default) is the existing behaviour.'right'puts a block on the previous block's top row,gapempty columns after its last column, withoffset.colsandoffset.rowsadding 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 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. -
4669375: New entry
javascript-excel/importturns a user's.xlsxor.csvfile into{ columns, data }withimportDataset. 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,mapColumnsandapplyMapping.Other additions:
readgainsmaxRows. Rows past it are skipped without tokenizing them, while merges and sheet views are still read. It comes with aROWS_TRUNCATEDwarning.toDatasetgainsheaderRowsandjoinfor multi-row headers.- The worker client gains
importDataset. - New error codes:
SHEET_NOT_FOUND, andVALIDATION_FAILED(reserved for react-data-import).
-
07706d3:
importDatasetissues now name the field as it appears indatarows. With a schema,TYPE,ERROR_CELLandDATE_ORDER_AMBIGUOUSissues use the schema field name; they used the source column key. The new optionalcolumnproperty onImportIssueholds the source column key (also set bycoerceColumnsand onapplyMapping'sREQUIRED). A value that doesn't convert to a forced type in a required field gives oneTYPEissue, no longer aREQUIREDissue 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,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. -
68d2df8: New entry
javascript-excel/format:formatValue(value, numFmt, options)andformatCell(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,_xspacing and*xfills, 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 fromIntlfor 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
#RRGGBBstyles cached per style object, resolved border edges, display text through an optionalformathook (formatCellfrom/formatfits), 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:
toDatasetgainsskipTotals: 'auto' | boolean. The default'auto'drops a trailing row whose formulas are allSUBTOTAL(…), which is the totals rowfromDatasetwrites. SotoDataset(read(write(fromDataset(ds))))no longer returns the totals as a data row. PassskipTotals: falseto keep it. -
6ce413a:
importDatasetandapplyMapping: a schema field without a column is nownullin every row, andcolumnslists every schema field. An unmapped field's column has an empty title and letter,type: 'empty', and itsfield. 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 oneMAPPING_MISSINGissue, and isnullin the rows. -
e6a4a94: Add
javascript-excel/worker:exposeWorker()for the app's two-line worker file andcreateWorkerClient(worker)withwrite,read,toCsvandparseCsv; 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, andonProgressis throttled to one event per 50 ms. -
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 (z...
v2.0.0-beta.1
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 asQ1 / 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_FMTSand 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)andmm:ss.0. The ECMA-376 table lists other codes. This changesBUILTIN_NUM_FMTSand whatformatValue/formatCellshow for those ids: positive numbers keep a trailing space where the)would be (1,234.50), and 47 shows31:00.0instead of3100.0. Files are unaffected, because the writer writes only the id. - 5020077:
toDatasetwithheaderRows(andimportDatasetwith 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,FebgivesName,Q1 / Jan,Q1 / Febinstead ofName,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 andsanitizeSheetNamenow accept a name such as 30 letters plus an emoji (Excel for Mac accepts it), andsanitizeSheetNamecuts long names to 31 code points without splitting a surrogate pair.Historystays reserved in any case (Excel refuses it), andsanitizeSheetNameturns it intoSheet. - f7e976d:
detectHeader(andimportDatasetwithheader: '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,Salesover,Q1,Q2givesSales / 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
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
- 244577a: README: link the live playground (https://javascript-excel-playground.vercel.app/).
v2.0.0-alpha.7
Minor Changes
- 252a056:
fromDatasetsblocks take an optionalplacement: 'below' | 'right'.'below'(the default) is the existing behaviour.'right'puts a block on the previous block's top row,gapempty columns after its last column, withoffset.colsandoffset.rowsadding 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:
readnow 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:
toUint8ArrayandtoBlobnow 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.