> ## Documentation Index
> Fetch the complete documentation index at: https://docs.reducto.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Installation

> [!NOTE]
>
> The Excel packages are in private preview with alpha customers. [Contact us](https://reducto.ai/contact?source=docs_office_xlsx) to get access.

## Install

```sh theme={null}
npm install @reductoai/xlsx
```

For the editor UI, also install the editor package:

```sh theme={null}
npm install @reductoai/xlsx-editor
```

The package is ESM only (`"type": "module"`).

## Optional modules (Node)

The core package has no native dependencies. PDF and PNG export in Node need two optional peers:

| Module | Used for |
| - | - |
| `skia-canvas` | Paints the sheets for `toPdf` and `toPng` |
| `@reductoai/portable-fonts` | The fonts text is measured and painted with |

```sh theme={null}
npm install skia-canvas @reductoai/portable-fonts
```

Without them, `toPdf` and `toPng` throw an error that names the missing module. Open, edit, calculate and save work without them.

## Bundlers

* `@reductoai/xlsx`, `/officejs`, `/view` and `/editor` have no Node imports. Vite, webpack and esbuild bundle them for a page with no alias or polyfill.
* Keep `@reductoai/xlsx/node` out of client code. It reads and writes files and loads `skia-canvas`.

## Smoke test

```ts theme={null}
import { ExcelWorkbook } from "@reductoai/xlsx/node";

const book = ExcelWorkbook.create();
const sheet = book.worksheets.getActiveWorksheet();
sheet.getRange("A1:B1").values = [["Hello", 41]];
sheet.getRange("C1").formulas = [["=B1+1"]];
await book.save("hello.xlsx");
await book.toPdf("hello.pdf");
```

Run it with `npx tsx smoke.ts` (or compile it first). Open `hello.xlsx` in Microsoft Excel; `C1` shows `42`.
