{
  "id": 22341086,
  "title": "Zero-Dependency OpenXML (.xlsx) in Node.js Without Corrupting Excel Styles",
  "url": "https://urgent.news/2026/11/28/zero-dependency-openxml-xlsx-in-node-js-without-corrupting-excel",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-11-28T10:10:56.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/larkandlever/zero-dependency-openxml-xlsx-in-nodejs-without-corrupting-excel-styles-4ge3"
  },
  "original_language": null,
  "account": "Exporting multi-sheet .xlsx spreadsheets with formatted currency headers and live formulas from a lightweight Node.js script is possible without pulling in a multi-megabyte dependency chain. According to the source, an .xlsx file is essentially a standard ZIP archive containing small UTF-8 XML files that adhere to ECMA-376 OpenXML. With knowledge of the three strict invariants Microsoft Excel and LibreOffice Calc expects, it's possible to emit rock-solid workbooks in just 150 lines of Node.js with zero npm spreadsheet dependencies.\n\nTo achieve this, the minimum archive layout requires three parts: Content_Types.xml, _rels/.rels, and xl/, which includes workbook.xml, _rels/workbook.xml.rels, styles.xml, and worksheets containing sheet1.xml and sheet2.xml. The cellXml function is used to serialize cell data into XML format, with special attention paid to avoiding leading \"=\" in f tags and caching precomputed values alongside f tags to ensure non-evaluating previewers display real numbers immediately. Additionally, styles.xml must reserve fills 0 and 1 for Excel to correctly render background colors and custom number formats require using numFmtId = 164 for currency formats.\n\nLastly, row ordering and column letters must adhere to strict ascending order, with rows and cells appearing in the correct order before stringifying to prevent XML validation failures. By following these guidelines, it's possible to create reliable .xlsx files without relying on heavy npm dependencies.",
  "summary": "If you have ever needed to export a multi-sheet .xlsx spreadsheet with formatted currency headers and live formulas ( SUM , ROUND , IFERROR ) from a lightweight Node.js script, pulling in a multi-megabyte dependency chain just to write four worksheets feels excessive. Under the hood, an .xlsx file is just a standard ZIP archive containing a small handful of UTF-8 XML files conforming to ECMA-376…",
  "summary_source": "publisher",
  "key_points": [
    ".xlsx files are ZIP archives with UTF-8 XML files adhering to ECMA-376 OpenXML standards",
    "Node.js script creates .xlsx files with zero npm spreadsheet dependencies, 150 lines of code",
    "Cell data serialized into XML format with special handling for formulas and number formats"
  ],
  "editors_take": null,
  "opinion": false,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "machine_translated": false,
  "ai_generated": true,
  "disclaimer": "Accounts, briefs, key points, the editor’s take and translations are written by software from other outlets’ reporting and may contain errors. A summary whose summary_source is \"publisher\" is the outlet’s own feed text. Always check the linked original."
}