const fs = require('fs'); const path = require('path'); const AdmZip = require('adm-zip'); function createBriefTemplate() { const zip = new AdmZip(); // [Content_Types].xml const contentTypes = ` `; // _rels/.rels const rels = ` `; // word/document.xml - Brief Template const document = ` {firma} {strasse} {plz} {stadt} {empfaenger_name} {empfaenger_strasse} {empfaenger_plz} {empfaenger_stadt} {datum} Betreff: {betreff} {anrede}, {nachricht} Mit freundlichen Grüßen {absender_name} {position} `; // Füge Dateien zum ZIP hinzu zip.addFile('[Content_Types].xml', Buffer.from(contentTypes, 'utf8')); zip.addFile('_rels/.rels', Buffer.from(rels, 'utf8')); zip.addFile('word/document.xml', Buffer.from(document, 'utf8')); // Speichere die Datei const outputPath = path.join(__dirname, 'templates', 'brief-template.docx'); zip.writeZip(outputPath); console.log('✅ Brief-Template mit docxtemplater-Syntax erstellt:', outputPath); } createBriefTemplate();