https://github.com/jsreport/jsreport-docxtemplater
Recipe using docxtemplater to create docx files
https://github.com/jsreport/jsreport-docxtemplater
Last synced: about 1 year ago
JSON representation
Recipe using docxtemplater to create docx files
- Host: GitHub
- URL: https://github.com/jsreport/jsreport-docxtemplater
- Owner: jsreport
- License: mit
- Created: 2018-11-23T12:06:09.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2021-10-12T19:12:56.000Z (over 4 years ago)
- Last Synced: 2025-03-27T11:43:35.705Z (about 1 year ago)
- Language: JavaScript
- Homepage: https://jsreport.net
- Size: 425 KB
- Stars: 8
- Watchers: 5
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
**⚠️ This repository has been moved to the monorepo [jsreport/jsreport](https://github.com/jsreport/jsreport)**
--
# jsreport-docxtemplater
[](https://npmjs.com/package/jsreport-docxtemplater)
[](https://travis-ci.org/jsreport/jsreport-docxtemplater)
jsreport recipe for creating docx word document using [docxtemplater](https://docxtemplater.readthedocs.io/en/latest/)
See https://jsreport.net/learn/docxtemplater
## Installation
> **npm install jsreport-docxtemplater**
## jsreport-core
You can apply this extension also manually to [jsreport-core](https://github.com/jsreport/jsreport-core)
```js
var jsreport = require('jsreport-core')()
jsreport.use(require('jsreport-docxtemplater')())
const result = await reporter.render({
template: {
engine: 'none',
recipe: 'docxtemplater',
docxtemplater: {
templateAsset: {
content: fs.readFileSync(path.join(__dirname, 'template.docx'))
}
}
},
data: {
name: 'John'
}
}
)
```