> ## 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.

# JS API in the browser

Import from `@reductoai/xlsx/officejs`. It is the same facade as in Node, without file paths and export. Open bytes, edit, and get bytes back.

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

const input = document.querySelector<HTMLInputElement>("input[type=file]")!;
const book = ExcelWorkbook.fromBytes(new Uint8Array(await input.files![0]!.arrayBuffer()));
book.worksheets.getItem("Sheet1").getRange("A1").values = [["Checked"]];
const out: Uint8Array = book.toBytes();
```

Send `out` to your server, or offer it as a download.

To show the workbook, see [View](https://docs.reducto.ai/office/xlsx/rendering/view.md). To let a user edit it, see [Editor](https://docs.reducto.ai/office/xlsx/ui/editor.md).

> [!NOTE]
>
> PDF export is in `@reductoai/xlsx/node` only. For a PNG of a range, import `@reductoai/xlsx/view` and call `range.getImage()` (see [PNG](https://docs.reducto.ai/office/xlsx/rendering/png.md#from-the-js-api)).
