hucre

Project name in large letters on a dark background, ringed by a spreadsheet grid, CSV rows, Excel formulas and a bar chart

XLSX, ODS and CSV from one dependency-free package

hucre reads and writes XLSX and ODS workbooks, CSV, JSON, NDJSON and XML, and it can also read the binary XLS and XLSB formats. The package is written in TypeScript with no dependencies, and its core never calls fs, crypto or Buffer. One install produces or parses Excel files on Node 24+, Bun, browsers, Cloudflare Workers and Vercel Edge Functions alike.

Constant-memory writes and byte-for-byte workbook edits

  • Each format has its own entry point (hucre/xlsx, hucre/csv, hucre/ods, hucre/json, hucre/xml). The README puts CSV alone at 3.7 KB gzipped and the whole package at 129 KB, and CI fails as soon as one of those sizes outgrows its budget.
  • writeXlsxStream pulls rows from any iterable, a database cursor for instance, and returns a ReadableStream. Memory tracks the number of distinct styles rather than rows: the repo's benchmark peaks at 67 MB of heap for a million rows.
  • openXlsx and saveXlsx copy every part hucre does not regenerate byte for byte, so charts, VBA macros and themes come through an edit intact. Going through readXlsx and writeXlsx instead rebuilds the workbook and drops whatever the model cannot describe, macros included.
  • Password-protected workbooks (the Agile encryption of Excel 2010 and later) can be read and written through WebCrypto.
  • validateWithSchema coerces types, checks required, pattern, min, max, enum or custom validators, and returns the errors separately, each with its row, field and value.
  • The npx hucre CLI converts, inspects and validates files, and accepts stdin as input.

Formulas left to Excel, XLS and XLSB read-only

hucre has no formula engine. It writes formulas, plus a cached result when given one, yet every workbook it produces tells Excel to recalculate everything on open, so a formulaResult value only matters to other tools. The roadmap lists formula evaluation under "not implemented yet".

XLS and XLSB are read-only, and only their values make it through. Both readers return sheet names, values, dates and merged cells. Convert one to XLSX and every formula becomes a fixed value, styles and dimensions are dropped, and hidden sheets turn visible, as the repo's docs/PARITY.md spells out.

ODS keeps six style properties: bold, italic, font size, font colour, background colour and number format. An XLSX converted to ODS silently loses its borders, column widths, frozen panes and data validation.

Streaming reads get expensive when strings vary. streamXlsxRows loads the whole shared-string table up front. On 100,000 rows by 12 columns, the README records 556 MB with 400,000 distinct strings against 90 MB with 10, and an export full of names or SKUs lands in the first case.

The project compares itself with SheetJS and ExcelJS. Its README notes that SheetJS left npm and keeps styling for its paid tier, and that ExcelJS brings nine dependencies and ships CommonJS only.

Version 1.3.0 came out on 26 October 2026. Version 1.0.0, released on 4 August, turned the public API into a stability commitment, with the hucre/ooxml entry point as the one exception. There have been thirteen releases, starting with 0.1.0 in March 2026. The README names the GitHub repository and the hucre npm package as the only official sources and states that the hucre.dev website is not affiliated with the project.