@office-open/xlsx 0.9.5 → 0.9.7

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
@@ -71,36 +71,36 @@ Check the [demo folder](./demo) for working examples covering every feature.
71
71
 
72
72
  Performance comparison against [hucre](https://github.com/nicolo-ribaudo/hucre) (higher ops/s is better, Windows 11 / Node 24).
73
73
 
74
- **Default** = XML DEFLATE level 1 (SuperFast, matching MS Office) + media STORE. **All STORE** = no compression (`{ compression: { xml: 0 } }`). **hucre** (async only) uses `CompressionStream("deflate-raw")` when available, falls back to STORE per-entry when compression doesn't reduce size.
74
+ **Default** = XML DEFLATE level 1 (SuperFast); media is split by type, matching MS Office Excel — already-compressed formats (PNG/JPEG/GIF) are STOREd, the rest (EMF/WMF/BMP/TIFF/…) use DEFLATE level 1 (verified on a real MS Office file). **All STORE** = no compression (`{ compression: { xml: 0, media: 0 } }`). **hucre** (async only) uses `CompressionStream("deflate-raw")` when available, falls back to STORE per-entry when compression doesn't reduce size.
75
75
 
76
76
  ```typescript
77
77
  // Default (matches MS Office)
78
78
  await generateWorkbook(options);
79
79
  // All STORE (no compression)
80
- await generateWorkbook(options, { compression: { xml: 0 } });
80
+ await generateWorkbook(options, { compression: { xml: 0, media: 0 } });
81
81
  ```
82
82
 
83
83
  **Create + toBuffer (end-to-end)**
84
84
 
85
85
  | Scenario | Default sync | Default async | All STORE sync | All STORE async | hucre |
86
86
  | ---------------- | -----------: | ------------: | -------------: | --------------: | ----------: |
87
- | Simple (3 rows) | 2,385 ops/s | 1,142 ops/s | 14,583 ops/s | 15,943 ops/s | 951 ops/s |
88
- | Styled rows (20) | 2,355 ops/s | 1,195 ops/s | 16,765 ops/s | 12,852 ops/s | 1,083 ops/s |
89
- | Table (10x5) | 2,357 ops/s | 1,177 ops/s | 16,480 ops/s | 13,716 ops/s | 1,049 ops/s |
87
+ | Simple (3 rows) | 2,416 ops/s | 1,160 ops/s | 14,593 ops/s | 17,853 ops/s | 1,062 ops/s |
88
+ | Styled rows (20) | 2,446 ops/s | 1,128 ops/s | 15,780 ops/s | 15,544 ops/s | 1,075 ops/s |
89
+ | Table (10x5) | 2,361 ops/s | 1,195 ops/s | 16,784 ops/s | 16,723 ops/s | 907 ops/s |
90
90
 
91
91
  **Large Files — Create + toBuffer**
92
92
 
93
93
  | Scenario | Default sync | Default async | All STORE sync | All STORE async | hucre |
94
94
  | ----------------------------- | -----------: | ------------: | -------------: | --------------: | --------: |
95
- | 2000 rows + 10 images | 79 ops/s | 75 ops/s | 89 ops/s | 93 ops/s | 44 ops/s |
96
- | 200x10 table | 847 ops/s | 610 ops/s | 1,118 ops/s | 1,011 ops/s | 261 ops/s |
97
- | 20 sheets × 100 rows + 20 img | 49 ops/s | 39 ops/s | 60 ops/s | 62 ops/s | 26 ops/s |
95
+ | 2000 rows + 10 images | 110 ops/s | 92 ops/s | 86 ops/s | 91 ops/s | 44 ops/s |
96
+ | 200x10 table | 853 ops/s | 614 ops/s | 1,142 ops/s | 1,122 ops/s | 258 ops/s |
97
+ | 20 sheets × 100 rows + 20 img | 72 ops/s | 50 ops/s | 63 ops/s | 62 ops/s | 25 ops/s |
98
98
 
99
99
  **Large Data — 100,000 rows × 20 columns (2M cells)**
100
100
 
101
101
  | Scenario | Default sync | Default async | All STORE sync | All STORE async | hucre |
102
102
  | --------- | -----------: | ------------: | -------------: | --------------: | ---------: |
103
- | 100k × 20 | 0.84 ops/s | 0.83 ops/s | 0.90 ops/s | 0.94 ops/s | 0.39 ops/s |
103
+ | 100k × 20 | 0.87 ops/s | 0.81 ops/s | 1.02 ops/s | 0.96 ops/s | 0.39 ops/s |
104
104
 
105
105
  ## License
106
106
 
@@ -2820,8 +2820,8 @@ function aggregate(values, func) {
2820
2820
  case "count":
2821
2821
  case "countNums": return values.length;
2822
2822
  case "average": return values.reduce((a, b) => a + b, 0) / values.length;
2823
- case "max": return Math.max(...values);
2824
- case "min": return Math.min(...values);
2823
+ case "max": return values.reduce((a, b) => Math.max(a, b));
2824
+ case "min": return values.reduce((a, b) => Math.min(a, b));
2825
2825
  case "product": return values.reduce((a, b) => a * b, 1);
2826
2826
  case "var": return sampleVariance(values);
2827
2827
  case "varp": return populationVariance(values);
@@ -5127,4 +5127,4 @@ function resolveWsTarget(wsPath, target) {
5127
5127
  //#endregion
5128
5128
  export { Styles as C, sharedStringsDesc as E, worksheetDesc as S, SharedStrings as T, commentsDesc as _, workbookDesc as a, calcChainDesc as b, tableDesc as c, pivotTableDesc as d, PivotFilterType as f, drawingDesc as g, externalLinkDesc as h, buildTablePartsXml as i, pivotCacheDefDesc as l, collectUniqueValues as m, XlsxWriteContext as n, TableType as o, aggregate as p, buildExternalReferencesXml as r, TotalsRowFunction as s, XlsxReadContext as t, pivotCacheRecordsDesc as u, vmlNotesDesc as v, stylesDesc as w, stringifyWorksheet as x, chartsheetDesc as y };
5129
5129
 
5130
- //# sourceMappingURL=context-ChKe3x0r.mjs.map
5130
+ //# sourceMappingURL=context-D-5KiTi9.mjs.map