Generate .docx files from JS
Node
$ npm install jsdocx
Browser
<script src="https://unpkg.com/jsdocx"></script>
$ git clone https://github.com/zuck/jsdocx.git
$ cd jsdocx
$ npm install
$ npm run build
$ npm test
import * as jsdocx from 'jsdocx'
// ES5: var jsdocx = require('jsdocx')
let doc = new jsdocx.Document()
let p = doc.addParagraph()
p.addRun().addText('Hello World!')
p.addFormat().addHAlignment().setVal('center')
doc.generate().then((content) => {
// e.g. saveAs(content, 'hello.docx')
})
- http://officeopenxml.com/anatomyofOOXML.php
- https://gist.github.com/felipeochoa/81d8fa27901e8222c6ffbeb165a85acc
The MIT License (MIT)
Copyright (c) Emanuele Bertoldi