An open API service indexing awesome lists of open source software.

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

Awesome Lists containing this project

README

          

**⚠️ This repository has been moved to the monorepo [jsreport/jsreport](https://github.com/jsreport/jsreport)**
--

# jsreport-docxtemplater
[![NPM Version](http://img.shields.io/npm/v/jsreport-docxtemplater.svg?style=flat-square)](https://npmjs.com/package/jsreport-docxtemplater)
[![Build Status](https://travis-ci.org/jsreport/jsreport-docxtemplater.png?branch=master)](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'
}
}
)
```