UNPKG

docxtemplater

Version:

Generate docx, pptx, and xlsx from templates (Word, Powerpoint and Excel documents), from Node.js, the Browser and the command line

12 lines (11 loc) 332 B
"use strict"; var TxtTemplater = require("../text.js"); var doc = new TxtTemplater("Hello {user}, how are you ?"); var result = doc.render({ user: "John" }); if (result !== "Hello John, how are you ?") { // eslint-disable-next-line no-console console.log(result); throw new Error("TxtTemplater did not work as expected"); }