Browser usage
Edit workbooks in the browser with the same lossless engine, using Blob, File, and ArrayBuffer adapters.
Use @ironsheet/browser when workbook bytes come from a Blob, File,
ArrayBuffer, or a browser fetch response instead of the filesystem.
npm install @ironsheet/browserimport {
inspectWorkbookArchiveFromBlob,
openWorkbookFromBlob,
writeWorkbookToBlobSafely
} from "@ironsheet/browser";
const archive = await inspectWorkbookArchiveFromBlob(file);
if (!archive.accepted) {
throw new Error(archive.issues[0]?.message);
}
const workbook = await openWorkbookFromBlob(file);
await workbook.patchCell("Sheet1", "B2", "Hello from the browser");
const result = await writeWorkbookToBlobSafely(workbook);
if (!result.wrote) {
throw new Error("Ironsheet refused to write an invalid workbook");
}
const output = result.blob;The same workbook engine and lossless guarantees apply as in Node — only IO
and compression differ. Every method documented in
Workbook API is available on the workbook
object returned by openWorkbookFromBlob.
How it adapts the core engine
The browser adapter uses CompressionStream and DecompressionStream with
deflate-raw. @ironsheet/core only requires a CompressionAdapter
boundary — it does not import Node's zlib, so the same engine runs
unmodified in both environments.
Core stays runtime-neutral
@ironsheet/core is dependency-free and browser-compatible by design.
Runtime-specific file IO and compression are pushed into @ironsheet/node
and @ironsheet/browser so the workbook engine itself never has to know
which environment it's running in.
Browser-safe writes
The browser package cannot own a filesystem transaction like @ironsheet/node,
but it can still refuse invalid output. writeWorkbookToBlobSafely validates
the in-memory package before creating a downloadable Blob:
const workbook = await openWorkbookFromBlob(file);
await workbook.patchNamedRange("RevenueRange", [["North", 42000]]);
const result = await writeWorkbookToBlobSafely(workbook);
if (!result.wrote) throw new Error("workbook failed validation");
const output = result.blob;inspectWorkbookArchiveFromBlob reads ZIP metadata without inflating worksheet
XML. Use it before opening untrusted files to enforce compressed, uncompressed,
entry-count, compression-ratio, and worksheet-size limits.
See it in a real browser workflow
The free Excel Table Refresher uses these public APIs inside a Web Worker to replace an Excel table from CSV without uploading either file.