docx-stream-template
Advanced tools
Comparing version 1.0.1 to 1.0.2
{ | ||
"name": "docx-stream-template", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "Simple stream template engine for create docx files in NodeJS", | ||
@@ -5,0 +5,0 @@ "main": "template.js", |
@@ -6,3 +6,3 @@ const Template = require('stream-text-variable-template'); | ||
function docxTemplate(props, docx) { | ||
const archive = new zip({ zlib: { level: 1 } }); | ||
const archive = new zip({ zlib: { level: 0 } }); | ||
docx.pipe(unzip.Parse()). | ||
@@ -13,7 +13,11 @@ on('entry', function (entry) { | ||
const stream = entry.pipe(new Template(props)); | ||
archive.entry(stream, { name: fileName }); | ||
process.nextTick(() => archive.entry(stream, { name: fileName })); | ||
} else { | ||
archive.entry(entry, { name: fileName }); | ||
if (fileName === '[Content_Types].xml') { | ||
archive.finalize(); | ||
process.nextTick(() => { | ||
archive.entry(entry, { name: fileName }) | ||
archive.finalize(); | ||
}); | ||
} else { | ||
process.nextTick(() => archive.entry(entry, { name: fileName })); | ||
} | ||
@@ -20,0 +24,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4177
28