xlcore

Render .xlsx workbooks to a <canvas> or PNG, in the browser, in Node, or straight from your terminal.

@hewliyang/xlsx-preview MIT
import { createWorkbookPreviewerFromFile }
  from "@hewliyang/xlsx-preview/browser";

await createWorkbookPreviewerFromFile(el, file);
// wasm runs in a Worker; xlsx never leaves the page.
import { ExcelPreviewer }
  from "@hewliyang/xlsx-preview/react";

<ExcelPreviewer file={file} />
// works in Vite, Next.js, anything that bundles ESM.
import { renderXlsxToPng } from "@hewliyang/xlsx-preview";
import { writeFile } from "node:fs/promises";

const png = await renderXlsxToPng("model.xlsx", { scale: 2 });
await writeFile("out.png", png);
$ npx xlsx-preview model.xlsx --info
$ npx xlsx-preview model.xlsx -o cover.png --scale 2
$ npx xlsx-preview model.xlsx -o "previews/{index}-{sheet}.png" --all
What it renders parity →
Charts · bar, line, pie
Conditional formatting
Dynamic arrays · spill
Tables · filter chrome
Embedded images
Comments · indicators
Outline groups
Number + date formats
Merged cells · wrap
Rich text · sup / sub
~Pivot tables · static
~Sparklines
~ — xlsx-preview — zsh
rendered e-007_input-4.xlsx
cover.png DCF · 477 KB · scale 2