@office-open/docx 0.10.15 → 0.11.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 -17
- package/dist/index.d.mts +3774 -33
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +16469 -530
- package/dist/index.mjs.map +1 -1
- package/package.json +17 -34
- package/dist/chart.d.mts +0 -1
- package/dist/chart.mjs +0 -2
- package/dist/comments-D_flVfxw.mjs +0 -8509
- package/dist/comments-D_flVfxw.mjs.map +0 -1
- package/dist/context-DLmSgNzb.mjs +0 -4536
- package/dist/context-DLmSgNzb.mjs.map +0 -1
- package/dist/core-properties-BLnZI4Tr.d.mts +0 -4004
- package/dist/core-properties-BLnZI4Tr.d.mts.map +0 -1
- package/dist/document-attributes-C6PDT-ap.mjs +0 -60
- package/dist/document-attributes-C6PDT-ap.mjs.map +0 -1
- package/dist/drawingml.d.mts +0 -1
- package/dist/drawingml.mjs +0 -2
- package/dist/generate-BNjgksa0.mjs +0 -535
- package/dist/generate-BNjgksa0.mjs.map +0 -1
- package/dist/generate.d.mts +0 -10
- package/dist/generate.d.mts.map +0 -1
- package/dist/generate.mjs +0 -2
- package/dist/parse-CgAxzk5K.mjs +0 -2115
- package/dist/parse-CgAxzk5K.mjs.map +0 -1
- package/dist/parse.d.mts +0 -2
- package/dist/parse.mjs +0 -2
- package/dist/patch/index.d.mts +0 -47
- package/dist/patch/index.d.mts.map +0 -1
- package/dist/patch/index.mjs +0 -416
- package/dist/patch/index.mjs.map +0 -1
- package/dist/smartart.d.mts +0 -1
- package/dist/smartart.mjs +0 -2
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|

|
|
5
5
|

|
|
6
6
|
|
|
7
|
-
>
|
|
7
|
+
> Create Word documents (.docx) in TypeScript and JavaScript — generate, parse, and patch from plain JSON, no Microsoft Office required. Built for AI agents and hand-written code alike; runs in Node.js, browsers, Deno, and Bun.
|
|
8
8
|
|
|
9
9
|
## Features
|
|
10
10
|
|
|
@@ -86,32 +86,36 @@ Performance vs original `docx` (9.6.1) package (higher ops/s is better, Windows
|
|
|
86
86
|
await generateDocument(options);
|
|
87
87
|
// All STORE (no compression)
|
|
88
88
|
await generateDocument(options, { compression: { xml: 0, media: 0 } });
|
|
89
|
+
// Stream as ReadableStream<Uint8Array> (pipe to a file / HTTP response)
|
|
90
|
+
generateDocumentStream(options);
|
|
89
91
|
```
|
|
90
92
|
|
|
91
|
-
**Create + toBuffer (end-to-end)**
|
|
93
|
+
**Create + toBuffer / toStream (end-to-end)**
|
|
92
94
|
|
|
93
|
-
| Scenario | Default sync | Default async | All STORE sync | All STORE async | docx |
|
|
94
|
-
| ------------------------------ | -----------: | ------------: | -------------: | --------------: | ---------: |
|
|
95
|
-
| Simple (2p + 1 img) |
|
|
96
|
-
| Styled paragraphs (20) + 1 img |
|
|
97
|
-
| Table (10x5) | 1,
|
|
98
|
-
| Full featured + 2 imgs |
|
|
95
|
+
| Scenario | Default sync | Default async | All STORE sync | All STORE async | Default stream | docx |
|
|
96
|
+
| ------------------------------ | -----------: | ------------: | -------------: | --------------: | -------------: | ---------: |
|
|
97
|
+
| Simple (2p + 1 img) | 868 ops/s | 562 ops/s | 2,334 ops/s | 2,312 ops/s | 13.9 ops/s | 71.4 ops/s |
|
|
98
|
+
| Styled paragraphs (20) + 1 img | 944 ops/s | 567 ops/s | 2,720 ops/s | 2,494 ops/s | 13.0 ops/s | 84.1 ops/s |
|
|
99
|
+
| Table (10x5) | 1,081 ops/s | 590 ops/s | 2,583 ops/s | 2,774 ops/s | 12.9 ops/s | 205 ops/s |
|
|
100
|
+
| Full featured + 2 imgs | 777 ops/s | 488 ops/s | 1,433 ops/s | 1,645 ops/s | 11.1 ops/s | 49.7 ops/s |
|
|
99
101
|
|
|
100
|
-
**Large Files — Create + toBuffer**
|
|
102
|
+
**Large Files — Create + toBuffer / toStream**
|
|
101
103
|
|
|
102
|
-
| Scenario | Default sync | Default async | All STORE sync | All STORE async | docx |
|
|
103
|
-
| ------------------------------ | -----------: | ------------: | -------------: | --------------: | ---------: |
|
|
104
|
-
| 2000 paragraphs + 20 images |
|
|
105
|
-
| 200x10 table |
|
|
106
|
-
| 20 sections x 100p + 40 images |
|
|
104
|
+
| Scenario | Default sync | Default async | All STORE sync | All STORE async | Default stream | docx |
|
|
105
|
+
| ------------------------------ | -----------: | ------------: | -------------: | --------------: | -------------: | ---------: |
|
|
106
|
+
| 2000 paragraphs + 20 images | 107.9 ops/s | 83.9 ops/s | 112.9 ops/s | 105.3 ops/s | 8.52 ops/s | 2.66 ops/s |
|
|
107
|
+
| 200x10 table | 215.8 ops/s | 173.7 ops/s | 215.2 ops/s | 218.4 ops/s | 6.30 ops/s | 33.2 ops/s |
|
|
108
|
+
| 20 sections x 100p + 40 images | 83.8 ops/s | 67.4 ops/s | 103.4 ops/s | 103.8 ops/s | 3.14 ops/s | 1.67 ops/s |
|
|
107
109
|
|
|
108
110
|
**Large File (~100MB) — Mixed Content**
|
|
109
111
|
|
|
110
112
|
500 styled paragraphs + 38 mixed-size images (1-5MB, 100MB total) + 50x10 table.
|
|
111
113
|
|
|
112
|
-
| Scenario | Default sync | Default async | All STORE sync | All STORE async | docx |
|
|
113
|
-
| ------------------------ | -----------: | ------------: | -------------: | --------------: | ---------: |
|
|
114
|
-
| Mixed (500p+38img+50x10) | 23.
|
|
114
|
+
| Scenario | Default sync | Default async | All STORE sync | All STORE async | Default stream | docx |
|
|
115
|
+
| ------------------------ | -----------: | ------------: | -------------: | --------------: | -------------: | ---------: |
|
|
116
|
+
| Mixed (500p+38img+50x10) | 23.9 ops/s | 22.9 ops/s | 24.2 ops/s | 24.6 ops/s | 3.59 ops/s | 0.29 ops/s |
|
|
117
|
+
|
|
118
|
+
**Stream column** = `generateDocumentStream` (default compression, fully drained). Streaming trades throughput for pipeability: each part is compressed in a Web Worker as it is produced, so a fixed per-part worker handoff dominates small documents — streaming targets memory footprint and piping (file / HTTP response), not peak ops/s.
|
|
115
119
|
|
|
116
120
|
## License
|
|
117
121
|
|