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.
lodash has been updated to version 4.17.23 to address a reported security vulnerability affecting the omit and unset functions (details: on this Github Advisory).
In our codebase, these functions are not used with user-controlled paths, meaning the vulnerability could not be exploited in our context. This update is applied as a precaution and to stay aligned with security best practices.
Initial release.