Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zuck/jsdocx
Generate .docx files from JS
https://github.com/zuck/jsdocx
docx js msoffice word
Last synced: about 1 month ago
JSON representation
Generate .docx files from JS
- Host: GitHub
- URL: https://github.com/zuck/jsdocx
- Owner: zuck
- License: mit
- Created: 2017-03-04T15:52:02.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2023-03-01T20:19:32.000Z (almost 2 years ago)
- Last Synced: 2024-05-13T02:20:29.135Z (7 months ago)
- Topics: docx, js, msoffice, word
- Language: JavaScript
- Homepage: https://zuck.github.io/jsdocx
- Size: 2.65 MB
- Stars: 19
- Watchers: 2
- Forks: 7
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
![jsdocx](https://cdn.rawgit.com/zuck/jsdocx/b70fc554/jsdocx.svg)
# jsdocx
> Generate .docx files from JS
[![Node.js CI](https://github.com/zuck/jsdocx/actions/workflows/node.js.yml/badge.svg)](https://github.com/zuck/jsdocx/actions/workflows/node.js.yml)
## Demo
https://zuck.github.io/jsdocx
## Install
**Node**
```bash
$ npm install jsdocx
```**Browser**
```html```
## Build
```bash
$ git clone https://github.com/zuck/jsdocx.git
$ cd jsdocx
$ npm install
$ npm run build
```## Test
```bash
$ npm test
```## How to use
```js
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')
})
```## Reference
- http://officeopenxml.com/anatomyofOOXML.php
- https://gist.github.com/felipeochoa/81d8fa27901e8222c6ffbeb165a85acc## License
The [MIT License](./LICENSE) (MIT)
Copyright (c) Emanuele Bertoldi