@office-open/docx 0.4.5 → 0.5.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 CHANGED
@@ -49,21 +49,21 @@ import { Document, Paragraph, TextRun, Packer } from "@office-open/docx";
49
49
  import { writeFileSync } from "node:fs";
50
50
 
51
51
  const doc = new Document({
52
- sections: [
53
- {
54
- children: [
55
- new Paragraph({
56
- children: [
57
- new TextRun("Hello World"),
58
- new TextRun({
59
- text: " - Bold text",
60
- bold: true,
61
- }),
62
- ],
63
- }),
64
- ],
65
- },
66
- ],
52
+ sections: [
53
+ {
54
+ children: [
55
+ new Paragraph({
56
+ children: [
57
+ new TextRun("Hello World"),
58
+ new TextRun({
59
+ text: " - Bold text",
60
+ bold: true,
61
+ }),
62
+ ],
63
+ }),
64
+ ],
65
+ },
66
+ ],
67
67
  });
68
68
 
69
69
  const buffer = await Packer.toBuffer(doc);
@@ -82,27 +82,27 @@ Performance comparison against original `docx` (9.6.1) package (Windows 11 / Nod
82
82
 
83
83
  | Scenario | @office-open/docx | docx | Speedup |
84
84
  | ------------------------------------------------------- | ----------------: | ---------: | -------: |
85
- | Simple document (2 paragraphs) | 26.7K ops/s | 4.9K ops/s | **5.5x** |
86
- | Styled paragraphs (20 paragraphs) | 24.3K ops/s | 4.1K ops/s | **6.0x** |
87
- | Table (10x5 cells) | 17.8K ops/s | 3.0K ops/s | **5.9x** |
88
- | Full featured (header/footer/headings/table/paragraphs) | 13.1K ops/s | 2.4K ops/s | **5.5x** |
85
+ | Simple document (2 paragraphs) | 28.7K ops/s | 6.5K ops/s | **4.4x** |
86
+ | Styled paragraphs (20 paragraphs) | 29.5K ops/s | 5.1K ops/s | **5.8x** |
87
+ | Table (10x5 cells) | 20.8K ops/s | 4.0K ops/s | **5.2x** |
88
+ | Full featured (header/footer/headings/table/paragraphs) | 16.9K ops/s | 2.9K ops/s | **5.8x** |
89
89
 
90
90
  **Create + toBuffer (end-to-end)**
91
91
 
92
92
  | Scenario | @office-open/docx | docx | Speedup |
93
93
  | ------------------------------------------------------- | ----------------: | --------: | -------: |
94
- | Simple document (2 paragraphs) | 1,413 ops/s | 182 ops/s | **7.8x** |
95
- | Styled paragraphs (20 paragraphs) | 1,593 ops/s | 196 ops/s | **8.1x** |
96
- | Table (10x5 cells) | 1,167 ops/s | 174 ops/s | **6.7x** |
97
- | Full featured (header/footer/headings/table/paragraphs) | 784 ops/s | 162 ops/s | **4.8x** |
94
+ | Simple document (2 paragraphs) | 1,881 ops/s | 220 ops/s | **8.6x** |
95
+ | Styled paragraphs (20 paragraphs) | 1,857 ops/s | 242 ops/s | **7.7x** |
96
+ | Table (10x5 cells) | 1,421 ops/s | 236 ops/s | **6.0x** |
97
+ | Full featured (header/footer/headings/table/paragraphs) | 923 ops/s | 190 ops/s | **4.9x** |
98
98
 
99
99
  **Large Files — Create + toBuffer**
100
100
 
101
101
  | Scenario | @office-open/docx | docx | Speedup |
102
102
  | --------------------------- | ----------------: | --------: | -------: |
103
- | 500 paragraphs | 182 ops/s | 84 ops/s | **2.2x** |
104
- | 100×10 table | 122 ops/s | 57 ops/s | **2.1x** |
105
- | 10 sections × 50 paragraphs | 267 ops/s | 103 ops/s | **2.6x** |
103
+ | 500 paragraphs | 227 ops/s | 105 ops/s | **2.2x** |
104
+ | 100×10 table | 170 ops/s | 78 ops/s | **2.2x** |
105
+ | 10 sections × 50 paragraphs | 345 ops/s | 138 ops/s | **2.5x** |
106
106
 
107
107
  ## License
108
108
 
@@ -0,0 +1 @@
1
+ var e=Object.defineProperty,t=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,r=Object.prototype.hasOwnProperty,i=(e,t)=>()=>(e&&(t=e(e=0)),t),a=(t,n)=>{let r={};for(var i in t)e(r,i,{get:t[i],enumerable:!0});return n||e(r,Symbol.toStringTag,{value:`Module`}),r},o=(i,a,o,s)=>{if(a&&typeof a==`object`||typeof a==`function`)for(var c=n(a),l=0,u=c.length,d;l<u;l++)d=c[l],!r.call(i,d)&&d!==o&&e(i,d,{get:(e=>a[e]).bind(null,d),enumerable:!(s=t(a,d))||s.enumerable});return i},s=(e,t,n)=>(o(e,t,`default`),n&&o(n,t,`default`)),c=t=>r.call(t,`module.exports`)?t[`module.exports`]:o(e({},`__esModule`,{value:!0}),t);export{c as i,a as n,s as r,i as t};