@office-open/xlsx 0.8.0 → 0.9.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
@@ -44,10 +44,10 @@ bun add @office-open/xlsx
44
44
  ## Quick Start
45
45
 
46
46
  ```typescript
47
- import { Workbook, Packer } from "@office-open/xlsx";
47
+ import { generateWorkbook } from "@office-open/xlsx";
48
48
  import { writeFileSync } from "node:fs";
49
49
 
50
- const wb = new Workbook({
50
+ const buffer = await generateWorkbook({
51
51
  worksheets: [
52
52
  {
53
53
  name: "Sheet1",
@@ -60,7 +60,6 @@ const wb = new Workbook({
60
60
  ],
61
61
  });
62
62
 
63
- const buffer = await Packer.toBuffer(wb);
64
63
  writeFileSync("workbook.xlsx", buffer);
65
64
  ```
66
65
 
@@ -70,41 +69,39 @@ Check the [demo folder](./demo) for working examples covering every feature.
70
69
 
71
70
  ## Benchmark
72
71
 
73
- Performance comparison against [hucre](https://github.com/nicolo-ribaudo/hucre) (0.6.0) (higher ops/s is better, Windows 11 / Node 24).
72
+ Performance comparison against [hucre](https://github.com/nicolo-ribaudo/hucre) (higher ops/s is better, Windows 11 / Node 24).
74
73
 
75
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.
76
75
 
77
76
  ```typescript
78
77
  // Default (matches MS Office)
79
- await Packer.toBuffer(wb);
78
+ await generateWorkbook(options);
80
79
  // All STORE (no compression)
81
- await Packer.toBuffer(wb, { compression: { xml: 0 } });
80
+ await generateWorkbook(options, { compression: { xml: 0 } });
82
81
  ```
83
82
 
84
83
  **Create + toBuffer (end-to-end)**
85
84
 
86
85
  | Scenario | Default sync | Default async | All STORE sync | All STORE async | hucre |
87
86
  | ---------------- | -----------: | ------------: | -------------: | --------------: | ----------: |
88
- | Simple (3 rows) | 3,528 ops/s | 1,266 ops/s | 17,759 ops/s | 17,193 ops/s | 949 ops/s |
89
- | Styled rows (20) | 3,403 ops/s | 1,289 ops/s | 16,516 ops/s | 13,811 ops/s | 971 ops/s |
90
- | Table (10x5) | 3,449 ops/s | 1,414 ops/s | 16,036 ops/s | 13,475 ops/s | 1,031 ops/s |
87
+ | Simple (3 rows) | 2,244 ops/s | 997 ops/s | 15,327 ops/s | 16,951 ops/s | 956 ops/s |
88
+ | Styled rows (20) | 2,148 ops/s | 1,230 ops/s | 13,962 ops/s | 13,854 ops/s | 989 ops/s |
89
+ | Table (10x5) | 2,141 ops/s | 1,237 ops/s | 14,876 ops/s | 14,250 ops/s | 1,031 ops/s |
91
90
 
92
91
  **Large Files — Create + toBuffer**
93
92
 
94
- | Scenario | Default sync | Default async | All STORE sync | All STORE async | hucre |
95
- | ----------------------------- | -----------: | ------------: | -------------: | --------------: | ---------: |
96
- | 2000 rows + 10 images | 87.5 ops/s | 79.7 ops/s | 101.0 ops/s | 101.2 ops/s | 46.4 ops/s |
97
- | 200x10 table | 754 ops/s | 517 ops/s | 1,049 ops/s | 963 ops/s | 226 ops/s |
98
- | 20 sheets x 100 rows + 20 img | 60.9 ops/s | 49.9 ops/s | 76.8 ops/s | 77.5 ops/s | 25.3 ops/s |
93
+ | Scenario | Default sync | Default async | All STORE sync | All STORE async | hucre |
94
+ | ----------------------------- | -----------: | ------------: | -------------: | --------------: | --------: |
95
+ | 2000 rows + 10 images | 69 ops/s | 66 ops/s | 76 ops/s | 71 ops/s | 43 ops/s |
96
+ | 200x10 table | 701 ops/s | 512 ops/s | 863 ops/s | 875 ops/s | 259 ops/s |
97
+ | 20 sheets × 100 rows + 20 img | 42 ops/s | 36 ops/s | 54 ops/s | 55 ops/s | 24 ops/s |
99
98
 
100
- **Large Data — 100,000 rows x 20 columns (2M cells)**
99
+ **Large Data — 100,000 rows × 20 columns (2M cells)**
101
100
 
102
- | Method | Speed | Speedup |
103
- | --------- | ---------: | -------: |
104
- | All STORE | 0.74 ops/s | **1.9x** |
105
- | Default | 0.66 ops/s | 1.7x |
106
- | hucre | 0.40 ops/s | |
101
+ | Scenario | Default sync | Default async | All STORE sync | All STORE async | hucre |
102
+ | --------- | -----------: | ------------: | -------------: | --------------: | ---------: |
103
+ | 100k × 20 | 0.68 ops/s | 0.65 ops/s | 0.72 ops/s | 0.71 ops/s | 0.38 ops/s |
107
104
 
108
105
  ## License
109
106
 
110
- - [MIT](LICENSE) © [Demo Macro](https://imst.xyz/)
107
+ - [MIT](LICENSE) © [Demo Macro](https://www.demomacro.com/)