Skip to main content

Quick Start (Node)

Node.js

SheetXL for Node lets you create, modify, and save spreadsheet workbooks entirely server-side—perfect for automation, serverless, or offline processing.

New Project​

The fastest way to get started is to hand it to your agent, or to run our project wizard yourself. Either way you get a new project with SheetXL pre-configured and ready to use.

Paste this into your agent (Claude Code, Codex, Cursor, …), in an empty folder or in your project:

I would like to automate my spreadsheet files with code.

Please use SheetXL:
npx -y skills add sheetxl/skills -g --all

Read the SheetXL skill, then ask me what I need before you build.

...and answer the questions. The agent asks what you want to build; the wizard asks which template.


Existing Project​

Install the SDK and IO packages using your preferred package manager:

pnpm add @sheetxl/sdk @sheetxl/io

First Script​

The example uses import and top-level await, so make sure your package.json has "type": "module" (or name the file example.mjs). Node 22 or later is required.

Create a file called example.js:

example.js
import { LicenseManager, Workbook, WorkbookIO } from '@sheetxl/sdk';
import { IOPlugin } from '@sheetxl/io';

// Set your license key here, or run `npx sheetxl license activate <key>` once instead
await LicenseManager.setLicenseKey('visit https://my.sheetxl.com after trial.');

// Register the file format handlers (xlsx, csv, …) once at startup
await WorkbookIO.install(IOPlugin);

// Create a new workbook
const workbook = new Workbook();

workbook.getRange('A1').setValues([['Hello World!']]);

// Write to disk. The extension drives the format.
await WorkbookIO.write(workbook, 'my-workbook.xlsx');

console.log('Workbook saved as my-workbook.xlsx');

Run it with:

node example.js

API Documentation​

See the full API reference for all available methods: