node-xlsx

TypeScript-first Excel parser and builder for Node.js, built on SheetJS.

Library
npm
v0.24.0
3,035 stars
Apache License 2.0

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
43 /100 Fair
Development Activity 0
Maintenance 20
Community 52
Maturity 60
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
63 /100 Good
Architecture 65
Code Quality 80
Innovation 65
Learning Curve 40

node-xlsx is a lightweight Node.js library for parsing and building Excel (.xlsx) files, wrapping the battle-tested SheetJS xlsx engine behind a simpler, TypeScript-friendly API. It converts spreadsheets to and from plain JavaScript arrays, so reading a workbook’s contents or generating a new one takes only a few lines of code instead of learning SheetJS’s full surface area.

Common use cases include exporting report data to Excel from a web backend, generating downloadable spreadsheets on demand, and ingesting user-uploaded Excel data into structured records. The library also ships a small CLI that builds an .xlsx file from a JSON payload piped over stdin, useful for quick scripting or shell-based automation without writing any Node.js code.

What You Get

  • Buffer or file-path input for parsing — pass a Buffer, a Uint8Array, or a path string directly to parse()
  • Multi-sheet workbook building via build(), each sheet given a name and a 2D array of row data
  • Column width, merged-cell-range, and worksheet-protection options through sheetOptions
  • Full TypeScript types for both the parse output and the build/worksheet option shapes
  • A bin CLI (node-xlsx) that reads a JSON worksheet payload from stdin and writes an .xlsx file

Common Use Cases

  • Exporting database query results to a downloadable Excel report from an API endpoint
  • Parsing user-uploaded .xlsx files into JSON for validation or import into a database
  • Generating multi-sheet spreadsheets with custom column widths and merged header cells
  • Scripting Excel file generation from the command line via the bundled CLI and stdin

Under The Hood

Architecture The library is a thin facade over SheetJS: src/index.ts exposes parse, parseMetadata, and build as pure functions that translate between node-xlsx’s simple {name, data} sheet shape and SheetJS’s native WorkBook/WorkSheet objects, src/workbook.ts supplies a minimal WorkBook class satisfying SheetJS’s type, src/config.ts wires Node’s fs module into SheetJS via set_fs so file-path reads and writes work outside the browser, and src/bin/cli.ts is a small stdin-driven wrapper around build(). There is no internal layering beyond this facade — if SheetJS’s own API shape changed, every call site here would need updating in lockstep.

Tech Stack Written in TypeScript 5.4 and built with tsup into dual CJS/ESM output plus declaration files, tested with Vitest, linted with ESLint and a shared config, and formatted with Prettier; the package manager is pnpm with a frozen lockfile enforced in CI. The single runtime dependency is the xlsx package itself, pulled directly from SheetJS’s own CDN tarball rather than the npm registry, since SheetJS no longer publishes every build there. There is no database or web framework involved — it is a pure file-processing library layered on Node’s fs module.

Code Quality A real test suite under test/specs exercises parsing, building, and edge cases (date fields, custom range functions, empty columns) against committed .xlsx/.json fixtures rather than mocks. Error handling is mostly implicit — parse and build let SheetJS’s own exceptions propagate uncaught. Naming is clear and consistent, types are exported for consumer use, and CI runs lint, Prettier, typecheck, and the full Vitest suite across multiple Node LTS versions plus a separate build-matrix job.

API Design The public surface is deliberately narrow — parse() and build() — trading SheetJS’s full object-model flexibility for arrays of arrays that most consumers actually want, while still allowing SheetJS’s raw cell notation (type, format, formula) for advanced cases. Getting started requires a single import and one function call, and the README documents every common scenario (buffer/file parsing, multi-sheet builds, column widths, merged ranges, primitive cell notation) with a runnable example.

Used by 5 apps in this directory

JavaScript
95%
MIT

AnythingLLM

AI Assistants · Automation · Developer Tools

66,533

The all-in-one AI platform for private document chat, no-code agents, and local LLMs with zero setup friction.

View details
90
Repo Health
78
Technical
64
Dependency
Built with
JavaScript 95%
Updated 6 days ago
JavaScript
99%
Other

ChartBrew

Analytics · Databases

4,063

Open-source reporting platform to build live dashboards from SQL, NoSQL, APIs, and SaaS tools with an AI assistant that creates charts from natural language.

View details
90
Repo Health
83
Technical
64
Dependency
Built with
JavaScript 99%
Updated 1 weeks ago
TypeScript
96%
AGPL 3.0

Midday

Invoicing Finance · Productivity

15,042

All-in-one AI-powered business operations platform for freelancers and solo entrepreneurs to manage invoicing, time tracking, banking, and financial intelligence.

View details
53
Repo Health
78
Technical
67
Dependency
Built with
TypeScript 96%
Updated 3 months ago
TypeScript
99%
Other

NocoBase

Low Code Platforms · No Code Platforms

24,377

Open-source AI + no-code platform that lets coding agents and people collaborate to build business systems fast on proven infrastructure.

View details
94
Repo Health
81
Technical
63
Dependency
Built with
TypeScript 99%
Updated 5 days ago
JavaScript
57%
AGPL 3.0

ToolJet

AI Agents · Low Code Platforms · No Code Platforms

41,007

Open-source AI-native platform to build and deploy internal tools, workflows, and AI agents with a visual drag-and-drop builder and 80+ data source integrations.

View details
94
Repo Health
81
Technical
63
Dependency
Built with
JavaScript 57%
TypeScript 36%
Updated 4 days ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers