docx-plus 0.1.7 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +21 -37
- package/dist/index.cjs +6 -33268
- package/dist/index.d.cts +1 -5110
- package/dist/index.d.mts +1 -5112
- package/dist/index.mjs +2 -32907
- package/package.json +13 -53
- package/dist/index.iife.js +0 -33270
- package/dist/index.umd.js +0 -33277
package/README.md
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
# docx-plus
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
[![PRs Welcome][pr-image]][pr-url]
|
|
3
|
+

|
|
4
|
+

|
|
5
|
+

|
|
7
6
|
|
|
8
|
-
Easily generate and modify .docx files with JS/TS. Works for Node and on the Browser.
|
|
7
|
+
Easily generate and modify .docx files with JS/TS. Works for Node.js and on the Browser.
|
|
9
8
|
|
|
10
|
-
**docx-plus** is an enhanced fork of [docx](https://github.com/dolanmiu/docx) — a TypeScript/JavaScript library for generating and modifying Word documents (.docx) programmatically with a declarative API.
|
|
9
|
+
**docx-plus** is an enhanced fork of [docx](https://github.com/dolanmiu/docx) by Dolan Miu — a TypeScript/JavaScript library for generating and modifying Word documents (.docx) programmatically with a declarative API. We extend our sincere gratitude to the original author and all contributors for their foundational work.
|
|
10
|
+
|
|
11
|
+
This package re-exports everything from `@office-open/docx` for backward compatibility. If you are starting a new project, we recommend using `@office-open/docx` directly.
|
|
11
12
|
|
|
12
13
|
## What's Different from docx?
|
|
13
14
|
|
|
@@ -46,7 +47,7 @@ Easily generate and modify .docx files with JS/TS. Works for Node and on the Bro
|
|
|
46
47
|
| Math advanced | Basic math only | **Complete** (box, borderBox, eqArr, groupChr, matrix, phant, accent, fraction, nAry, func, delim, bar, limLow, limUpp, sPre, sSub, sSup) |
|
|
47
48
|
| Group Shape | Basic (transform only) | **Enhanced** (fill, effects, `chOff`/`chExt` child coordinates) |
|
|
48
49
|
| Test environment | jsdom | happy-dom |
|
|
49
|
-
| OOXML compliance | ECMA-376 (legacy) | **ISO/IEC 29500-4** (latest) — comprehensive WordprocessingML, DrawingML, and Shared Math coverage
|
|
50
|
+
| OOXML compliance | ECMA-376 (legacy) | **ISO/IEC 29500-4** (latest) — comprehensive WordprocessingML, DrawingML, and Shared Math coverage |
|
|
50
51
|
|
|
51
52
|
## OOXML Coverage
|
|
52
53
|
|
|
@@ -63,21 +64,19 @@ Easily generate and modify .docx files with JS/TS. Works for Node and on the Bro
|
|
|
63
64
|
|
|
64
65
|
## Installation
|
|
65
66
|
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
|
|
67
|
+
```bash
|
|
68
|
+
# Install with npm
|
|
69
|
+
$ npm install docx-plus
|
|
69
70
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
// or
|
|
73
|
-
import { Document, Packer, Paragraph, TextRun } from "docx-plus";
|
|
71
|
+
# Install with pnpm
|
|
72
|
+
$ pnpm add docx-plus
|
|
74
73
|
```
|
|
75
74
|
|
|
76
|
-
## Quick
|
|
75
|
+
## Quick Start
|
|
77
76
|
|
|
78
|
-
```
|
|
79
|
-
import
|
|
80
|
-
import {
|
|
77
|
+
```typescript
|
|
78
|
+
import { Document, Paragraph, TextRun, Packer } from "docx-plus";
|
|
79
|
+
import { writeFileSync } from "node:fs";
|
|
81
80
|
|
|
82
81
|
const doc = new Document({
|
|
83
82
|
sections: [
|
|
@@ -98,28 +97,13 @@ const doc = new Document({
|
|
|
98
97
|
});
|
|
99
98
|
|
|
100
99
|
const buffer = await Packer.toBuffer(doc);
|
|
101
|
-
|
|
100
|
+
writeFileSync("My Document.docx", buffer);
|
|
102
101
|
```
|
|
103
102
|
|
|
104
|
-
## Documentation
|
|
105
|
-
|
|
106
|
-
Please refer to the [documentation](https://github.com/DemoMacro/docx-plus#readme) for details on how to use this library, examples and much more!
|
|
107
|
-
|
|
108
103
|
## Examples
|
|
109
104
|
|
|
110
|
-
Check the [demo folder](
|
|
111
|
-
|
|
112
|
-
## Contributing
|
|
113
|
-
|
|
114
|
-
Contributions are welcome! Please feel free to submit pull requests.
|
|
105
|
+
Check the [demo folder](../docx/demo) for 100+ working examples covering every feature.
|
|
115
106
|
|
|
116
|
-
|
|
107
|
+
## License
|
|
117
108
|
|
|
118
|
-
[
|
|
119
|
-
[npm-url]: https://npmjs.org/package/docx-plus
|
|
120
|
-
[downloads-image]: https://img.shields.io/npm/dm/docx-plus.svg
|
|
121
|
-
[downloads-url]: https://npmjs.org/package/docx-plus
|
|
122
|
-
[github-actions-workflow-image]: https://github.com/DemoMacro/docx-plus/workflows/Default/badge.svg?branch=main
|
|
123
|
-
[github-actions-workflow-url]: https://github.com/DemoMacro/docx-plus/actions
|
|
124
|
-
[pr-image]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg
|
|
125
|
-
[pr-url]: http://makeapullrequest.com
|
|
109
|
+
- [MIT](LICENSE) © [Demo Macro](https://imst.xyz/)
|