# docxtest

> Javascript port of python-docx.

Latest version **0.5.9** (published 2023-07-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install docxtest
pnpm add docxtest
yarn add docxtest
bun add docxtest
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; large bundle; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.5.9 |
| Published | 2023-07-09 |
| First published | 2022-10-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 14.1 MB |
| Known vulnerabilities | 0 (+8 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 23 |
| Author | Zhang Yu |
| Maintainers | zhangyu836 |
| Keywords | docx, docxjs, office, word, document, docxyz |

## Links

- npm: https://www.npmjs.com/package/docxtest
- Repository: https://github.com/zhangyu836/docxjs
- Homepage: https://github.com/zhangyu836/docxjs#readme
- Issues: https://github.com/zhangyu836/docxjs/issues
- npm.io page: https://npm.io/package/docxtest

## Dependencies (4)

- [xpath](https://npm.io/package/xpath.md) ^0.0.32
- [adm-zip](https://npm.io/package/adm-zip.md) ^0.5.9
- [shasum-object](https://npm.io/package/shasum-object.md) ^1.0.0
- [@xmldom/xmldom](https://npm.io/package/@xmldom/xmldom.md) ^0.8.2

## Alternatives

- [@cantoo/pdf-lib](https://npm.io/package/@cantoo/pdf-lib.md) — 297.9K weekly downloads
- [datatables.net-buttons](https://npm.io/package/datatables.net-buttons.md) — 200.1K weekly downloads
- [@ckeditor/ckeditor5-export-pdf](https://npm.io/package/@ckeditor/ckeditor5-export-pdf.md) — 167.0K weekly downloads
- [scanbot-web-sdk](https://npm.io/package/scanbot-web-sdk.md) — 15.0K weekly downloads
- [@syncfusion/ej2-angular-pdfviewer](https://npm.io/package/@syncfusion/ej2-angular-pdfviewer.md) — 8.8K weekly downloads

## Recent versions

- 0.5.9 (latest) — 2023-07-09
- 0.5.8 — 2023-06-28
- 0.5.7 — 2023-06-28
- 0.5.6 — 2023-06-24
- 0.5.5 — 2023-06-24
- 0.5.4 — 2023-06-07
- 0.5.3 — 2023-05-29
- 0.5.2 — 2023-05-29
- 0.5.1 — 2023-05-23
- 0.5.0 — 2023-05-23
- 0.4.9 — 2023-05-23
- 0.4.8 — 2023-05-23
- 0.4.7 — 2023-05-23
- 0.4.6 — 2023-05-23
- 0.4.5 — 2023-05-21
- … 24 more at https://npm.io/package/docxtest/versions

## README

Since v0.2.0 this package is published to npm as docxyz.

# docxyz
Javascript port of [python-docx](https://github.com/python-openxml/python-docx).  

## Installation
```shell
npm i docxyz
```

## Usage

### Write
```javascript
let {Document} = require('docxyz');
let document = new Document();
document.add_heading('Document Title', 0);
let p = document.add_paragraph('A plain paragraph having some ');
p.add_run('bold').bold = true;
p.add_run(' and some ');
p.add_run('italic.').italic = true;
document.add_heading('Heading, level 1', level=1);
document.add_paragraph('Intense quote', style='Intense Quote');
document.save('demo.docx');
```

### Read and write
```javascript
let {Document} = require('docxyz');
let fileName = './demo.docx';
let document = new Document(fileName);
let text = document.text;
console.log(text);
let p = document.add_paragraph('Another plain paragraph having some ');
p.add_run('bold').bold = true;
p.add_run(' and some ');
p.add_run('italic.').italic = true;
document.add_heading('Heading, level 2', level=2);
text = document.text;
console.log(text);
document.save('read_and_write.docx');
```

### Browser

```html
<script src='http://unpkg.com/docxyz'></script>
<script>
    console.log(docxyz);
    var Document = docxyz.Document;
    console.log(Document);
    console.log(Document());
</script>
```

See [examples](https://github.com/zhangyu836/docxjs/tree/main/demo).

## Documentation
Please read [python-docx documentation](https://python-docx.readthedocs.org/en/latest/) for now.

## Demo
[docx-slate](https://github.com/zhangyu836/docx-slate): A simple slatejs-based docx editor for demonstration of docxjs.  
Open [demo on github.io](https://zhangyu836.github.io/docx-slate/)  
Open [demo on codesandbox.io](https://codesandbox.io/s/docx-slate-2f4l1z)  
Open [demo on codesandbox.io](https://codesandbox.io/s/docx-slate-webpack4-3ldhk0)

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