@eagl-finance/celamine-node
v0.1.2
Published
Lightweight WASM-based spreadsheet parser (XLS, XLSX, ODS) powered by calamine
Maintainers
Readme
@eagl/celamine-node
Lightweight WASM-based spreadsheet parser for Node.js, powered by calamine.
Parses XLS (binary BIFF), XLSX, XLSB, and ODS files — returns all sheets as { name, rows }[].
Install
npm install @eagl/celamine-nodeUsage
import { getAllSheets } from "@eagl/celamine-node";
import { readFileSync } from "fs";
const buffer = readFileSync("spreadsheet.xlsx");
const sheets = getAllSheets(new Uint8Array(buffer));
for (const sheet of sheets) {
console.log(sheet.name, sheet.rows.length, "rows");
}API
getAllSheets(data: Uint8Array): SheetData[]
Returns all sheets from a workbook buffer.
type SheetData = {
name: string;
rows: (string | null)[][];
};Building from source
Requires wasm-pack and Rust.
npm run buildSupported formats
| Format | Extension | Magic bytes |
|--------|-----------|-------------|
| XLS (BIFF) | .xls | D0 CF 11 E0 |
| XLSX | .xlsx | 50 4B 03 04 (ZIP) |
| XLSB | .xlsb | 50 4B 03 04 (ZIP) |
| ODS | .ods | 50 4B 03 04 (ZIP) |
