exceljs
Read, write, and manipulate Excel workbooks in Node.js — full support for formulas, styles, charts, and streaming large datasets.
exceljs
General JSRead, write, and manipulate Excel workbooks in Node.js — full support for formulas, styles, charts, and streaming large datasets.
Fit
Bundle (gzip)
255.9 kB
932.5 kB raw
Install size includes transitive dependencies. Bundle size is gzipped browser payload.
Freshness
The Problem
Generating Excel reports in Node.js requires producing .xlsx files with proper formatting, column widths, cell styles, and formulas — not just raw CSV. Reading user-uploaded Excel files needs to handle merged cells, multiple sheets, and data types.
What It Does
ExcelJS creates and reads .xlsx files with full formatting support: fonts, colors, borders, alignment, merged cells, formulas, conditional formatting, and images. A streaming writer handles workbooks with hundreds of thousands of rows without memory exhaustion.
Installation
npm install exceljsUsage Example
import ExcelJS from 'exceljs';
const workbook = new ExcelJS.Workbook();
const sheet = workbook.addWorksheet('Sales Report');
sheet.columns = [
{ header: 'Product', key: 'product', width: 25 },
{ header: 'Revenue', key: 'revenue', width: 15 },
];
sheet.addRow({ product: 'Widget A', revenue: 15000 });
sheet.addRow({ product: 'Widget B', revenue: 23500 });
// Style header row
sheet.getRow(1).font = { bold: true, size: 12 };
sheet.getRow(1).fill = { type: 'pattern', pattern: 'solid', fgColor: { argb: 'FF4472C4' } };
await workbook.xlsx.writeFile('report.xlsx');Related packages
Unified TypeScript SDK for building AI-powered apps — switch between 20+ LLM providers without rewriting code.
animejsGeneral JSLightweight JavaScript animation library with a tiny footprint and a powerful, expressive API.
AOSGeneral JSAn easy-to-use library that makes elements fade, slide, or zoom into view as the user scrolls down your page.
archiverGeneral JSStreaming interface for generating ZIP and TAR archives in Node.js — create compressed archives programmatically from files, directories, and buffers.
@formkit/auto-animateGeneral JS> Add smooth transitions to any element with a single line — zero-config animations for adds, removes, and moves.