# commonform-docx

render [Common Form objects](https://www.npmjs.com/package/commonform-validate) in Office Open XML (Microsoft Word `.docx` format)

The exported function takes three arguments:

1. a Common Form

2. an Array of fill-in-the-blank values

3. an options Object

The options object must contain:

1. a `numbering` property whose value is an [abstract numbering](https://npmjs.com/package/abstract-numbering)

It may contain:

1. a `title` property whose value is a string

2. an `version` property whose value is a string

3. a `hash` property whose value is `true` or `false`

4. a `markFilled` property whose value is `true` or `false`

5. other properties you can find in function exported from `index.js`

The function returns a [JSZip](https://npmjs.com/package/jszip) Object primed with `.docx` document data.

For example:

```javascript
const zip = docx(form, {
  title: 'Example Document',
  version: 'Version 1.0.0'
})
await writeFile(
  'example.docx',
  await zip.generateAsync({ type: 'nodebuffer' })
)
```
