xls-reader — zero-dependency reader for legacy .xls (BIFF8 / Excel 97–2003)
0 dependencies npm provenance ~4 KB min+gzip Node & Browser TypeScript
npm install xls-reader

Read a legacy .xls in a few lines

Modern readers like ExcelJS only handle the newer .xlsx. SheetJS, the de-facto .xls reader, no longer publishes to npm. xls-reader is a small, focused, npm-published alternative for the common case — get the cell values out of a legacy .xls.

import { readFile } from "node:fs/promises";
import { readXls } from "xls-reader";

const workbook = readXls(await readFile("report.xls"));

for (const sheet of workbook.sheets) {
  for (const row of sheet.rows) {
    console.log(row); // ["BANCO X S/A", 1.1, 2024-04-02T00:00:00.000Z, ...]
  }
}

Convert an .xls to JSON

import { readFirstSheet } from "xls-reader";

const sheet = readFirstSheet(bytes);
const [header = [], ...body] = sheet?.rows ?? [];

const json = body.map((row) =>
  Object.fromEntries(header.map((key, i) => [String(key), row[i] ?? null])),
);

How it compares

xls-reader SheetJS (xlsx) ExcelJS
Reads legacy .xls (BIFF8)
Reads .xlsx (OOXML)
Latest fixes on npm ⚠️ frozen 0.18.5
Runtime dependencies 0 several several
npm provenance

FAQ

How do I read an .xls file in Node.js?

Install xls-reader, read the file into bytes, and call readXls(bytes). No native modules or extra setup.

Is this a SheetJS alternative?

For reading legacy .xls, yes — SheetJS no longer publishes to npm, so this is a zero-dependency, npm-published option for the cell values. It does not write files or read .xlsx.

Can it read .xlsx files?

No. .xlsx is a different (OOXML) format; use ExcelJS for that. xls-reader handles the older binary BIFF8 .xls.

Does it work in the browser?

Yes — it only needs Uint8Array / DataView, so pass an ArrayBuffer from a file input or fetch.