@fillwright/docx
v0.1.0-alpha.1
Published
Word-native DOCX template authoring and verified filling.
Readme
@fillwright/docx
Create and fill DOCX templates using native Microsoft Word content controls. Requires Node 24+ and ESM. This alpha package does not include the web studio.
Install the npm alpha:
npm install @fillwright/docx@alphaimport { readFile, writeFile } from "node:fs/promises";
import { fillDocx } from "@fillwright/docx/fill";
const result = await fillDocx(
await readFile("template.docx"),
[{ key: "client.name", label: "Client name", kind: "text", required: true, options: [] }],
{ "client.name": "Example Studio" },
);
await writeFile("filled.docx", result);The template must contain a supported inline plain-text control tagged client.name.
Values are checked after reopening the generated DOCX. Pass { removeFields: true }
as the fourth argument to remove registered controls while retaining filled text.
For TypeScript, install @types/node and include "node" in your compiler
types setting.
The main export provides Store for template authoring and portable packages;
@fillwright/docx/types provides Field, FillField and workflow types.
Alpha limitations
Creating a new field with the pinned SuperDoc engine drops direct font formatting. Filling verifies values, not complete visual fidelity. Check generated documents. Nested, repeated, rich-text and XML-bound controls are not supported fields.
Copyright (C) 2026 Caio Pizzol. Fillwright source is AGPL-3.0-only; see LICENSE. The SuperDoc SDK depends on a proprietary DOCX engine under separate terms. This archive contains Fillwright code; the SDK is installed as a dependency.
Source
The archive includes TypeScript source and a standalone build configuration.
From an extracted archive, run npm install --ignore-scripts and
npm run build to rebuild the JavaScript and declarations.
