Simple import and export of document

This commit is contained in:
Dolan
2023-02-08 03:18:11 +00:00
parent c713e6f371
commit ffd998cbf5
5 changed files with 52 additions and 0 deletions

View File

@ -0,0 +1,8 @@
// 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);
});