@ironsheet/node
v0.2.0
Published
Node.js IO, compression, and safe-write adapter for Ironsheet workbooks.
Maintainers
Readme
Node.js file IO, compression, and safe-write adapter for Ironsheet — the lossless TypeScript engine for editing real XLSX and XLSM files without breaking formulas, styles, charts, pivots, macros, or layout.
This is the package most Node users want. It bundles the runtime-neutral @ironsheet/core engine with filesystem IO, zlib compression, safe writes, and template render helpers.
Install
npm install @ironsheet/nodeUsage
Guarded mutation of an existing workbook — Ironsheet validates before it writes and refuses to produce a corrupt file:
import { mutateWorkbookFile } from "@ironsheet/node";
const report = await mutateWorkbookFile("template.xlsx", "report.xlsx", async (workbook) => {
await workbook.patchCell("Summary", "B2", "Q1");
await workbook.patchNamedRange("RevenueRange", [["North", 42000]]);
await workbook.replaceTableRows("RevenueTable", [["North", 42000]]);
});
if (!report.wrote) {
throw new Error("Ironsheet refused to write an invalid workbook");
}
console.log(report.diff.summary);Safe template rendering resolves anchors, validates the resize plan, then applies one transaction:
import { renderWorkbookTemplateSafely } from "@ironsheet/node";
const report = await renderWorkbookTemplateSafely("template.xlsm", "output.xlsm", {
names: [{ name: "RevenueRange", values: [["Region", "Amount"], ["North", 42000]] }],
tables: [{ tableName: "RevenueTable", rows: [["North", 42000], ["South", 31500]] }]
});Documentation
Full docs — guides, recipes, and the generated API reference — are at ironsheetdocs.vercel.app. Source, capabilities, and compatibility notes live in the Ironsheet monorepo.
