Skip to content

Commit

Permalink
add templateOptions to pass options to templater
Browse files Browse the repository at this point in the history
  • Loading branch information
lmillucci committed Oct 21, 2018
1 parent 04f90ff commit 6637a0c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,12 @@ const generateDocx = async options => {

const template = await readFile(options.template.filePath, 'binary')
const zip = new JSzip(template)
const templateOptions = options.templateOptions || {}

const document = new Docxtemplater()
.loadZip(zip)
.setData(options.template.data)
.setOptions(templateOptions)
.render()

const buf = document
Expand Down

0 comments on commit 6637a0c

Please sign in to comment.