Simplify patcher

Use map notation
This commit is contained in:
Dolan Miu
2023-02-25 22:18:31 +00:00
parent 4e875b4744
commit ce485dbc29
6 changed files with 52 additions and 268 deletions

View File

@ -0,0 +1,20 @@
// Generate a template document
// Import from 'docx' rather than '../build' if you install from npm
import * as fs from "fs";
import { Document, Packer, Paragraph, TextRun } from "../build";
const doc = new Document({
sections: [
{
children: [
new Paragraph({
children: [new TextRun("{{ template }}")],
}),
],
},
],
});
Packer.toBuffer(doc).then((buffer) => {
fs.writeFileSync("My Document.docx", buffer);
});