Files
docx-js/demo/85-template-document.ts

9 lines
275 B
TypeScript
Raw Normal View History

2023-02-08 03:18:11 +00:00
// Simple template example
// Import from 'docx' rather than '../build' if you install from npm
import * as fs from "fs";
import { fromDocx } from "../build";
fromDocx(fs.readFileSync("demo/template.docx")).then((doc) => {
fs.writeFileSync("My Document.docx", doc);
});