# @kth/kth-node-docx

> A docx export module for Node.js applications.

Latest version **2.0.4** (published 2022-07-20) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install @kth/kth-node-docx
pnpm add @kth/kth-node-docx
yarn add @kth/kth-node-docx
bun add @kth/kth-node-docx
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 2.0.4 |
| Published | 2022-07-20 |
| First published | 2021-08-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 51.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | KTH |
| Maintainers | kthwebmaster, wkchung, exacs, ssundkvist, kth-ci, emilstenberg |
| Keywords | kth |

## Links

- npm: https://www.npmjs.com/package/@kth/kth-node-docx
- Repository: https://github.com/KTH/kth-node-docx
- Homepage: https://github.com/KTH/kth-node-docx#readme
- Issues: https://github.com/KTH/kth-node-docx/issues
- npm.io page: https://npm.io/package/@kth/kth-node-docx

## Dependencies (3)

- [ramda](https://npm.io/package/ramda.md) ^0.27.1
- [pizzip](https://npm.io/package/pizzip.md) 3.1.1
- [docxtemplater](https://npm.io/package/docxtemplater.md) ^3.31.2

## Recent versions

- 2.0.4 (latest) — 2022-07-20
- 2.0.3 — 2021-12-09
- 2.0.2 — 2021-08-24
- 2.0.1 — 2021-08-19
- 2.0.0 — 2021-08-19

## README

# docx generator

Given a `docx` file with the following content:

```
{@publications}
```

And an XML string generated with the `template` and/or `docx` helpers:

```xml
<w:p><w:r><w:t>hello world</w:t></w:r></w:p>
```

## Code usage

```javascript
var fs = require('fs')
var docx = require('@kth/kth-node-docx')
var xml = '<w:p><w:r><w:t>hello world</w:t></w:r></w:p>'
var templateBuffer = fs.readFileSync('template.docx', 'binary')
var outputBuffer = docx.generate(xml, templateBuffer, 'publications')
fs.writeFileSync('publications.docx', outputBuffer)
```

For an example of how to use the XML helpers, see the
`test/integration.js` file.

---
_Source: https://npm.io/package/@kth/kth-node-docx · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
