Simple patcher working

This commit is contained in:
Dolan Miu
2023-02-18 20:36:24 +00:00
parent 86de252a52
commit 5233b4b5e6
6 changed files with 121 additions and 32 deletions

View File

@ -1,12 +1,12 @@
// Simple template example
// Import from 'docx' rather than '../build' if you install from npm
import * as fs from "fs";
import { Paragraph, patchDocument, TextRun } from "../build";
import { patchDocument, TextRun } from "../build";
patchDocument(fs.readFileSync("demo/assets/simple-template.docx"), {
patches: [
{
children: [new Paragraph("ff"), new TextRun("fgf")],
children: [new TextRun("John Doe")],
text: "{{ name }}",
},
],