With the ODT module, you can template ODT files (generated by libreoffice) using docxtemplater.
The module currently supports following features :
Your odt should contain the text: {name}
const OdtModule = require("docxtemplater-odt-module");
const fs = require("fs");
const doc = new Docxtemplater(zip, {
modules: [new OdtModule({})],
});
doc.render({ name: "John" });
const buffer = doc.toBuffer();
fs.writeFile("output.odt", buffer);
After installing the module, you can use a working demo by running node sample.js
.