@office-open/xlsx 0.8.1 → 0.9.1
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 +18 -21
- package/dist/context-BXK92u5G.mjs +5055 -0
- package/dist/context-BXK92u5G.mjs.map +1 -0
- package/dist/generate-BLESQtfS.d.mts +26 -0
- package/dist/generate-BLESQtfS.d.mts.map +1 -0
- package/dist/generate-BqlKnMiw.mjs +796 -0
- package/dist/generate-BqlKnMiw.mjs.map +1 -0
- package/dist/generate.d.mts +2 -0
- package/dist/generate.mjs +2 -0
- package/dist/index.d.mts +542 -2113
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +7 -5424
- package/dist/index.mjs.map +1 -1
- package/dist/parse-CZQQuAH5.d.mts +42 -0
- package/dist/parse-CZQQuAH5.d.mts.map +1 -0
- package/dist/parse.d.mts +2 -0
- package/dist/parse.mjs +233 -0
- package/dist/parse.mjs.map +1 -0
- package/dist/patch.d.mts +31 -0
- package/dist/patch.d.mts.map +1 -0
- package/dist/patch.mjs +101 -0
- package/dist/patch.mjs.map +1 -0
- package/dist/worksheet-BbJpRvw2.d.mts +1691 -0
- package/dist/worksheet-BbJpRvw2.d.mts.map +1 -0
- package/package.json +18 -5
package/README.md
CHANGED
|
@@ -44,10 +44,10 @@ bun add @office-open/xlsx
|
|
|
44
44
|
## Quick Start
|
|
45
45
|
|
|
46
46
|
```typescript
|
|
47
|
-
import {
|
|
47
|
+
import { generateWorkbook } from "@office-open/xlsx";
|
|
48
48
|
import { writeFileSync } from "node:fs";
|
|
49
49
|
|
|
50
|
-
const
|
|
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) (
|
|
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
|
|
78
|
+
await generateWorkbook(options);
|
|
80
79
|
// All STORE (no compression)
|
|
81
|
-
await
|
|
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) |
|
|
89
|
-
| Styled rows (20) |
|
|
90
|
-
| Table (10x5) |
|
|
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 |
|
|
91
90
|
|
|
92
91
|
**Large Files — Create + toBuffer**
|
|
93
92
|
|
|
94
|
-
| Scenario | Default sync | Default async | All STORE sync | All STORE async |
|
|
95
|
-
| ----------------------------- | -----------: | ------------: | -------------: | --------------: |
|
|
96
|
-
| 2000 rows + 10 images |
|
|
97
|
-
| 200x10 table |
|
|
98
|
-
| 20 sheets
|
|
93
|
+
| Scenario | Default sync | Default async | All STORE sync | All STORE async | hucre |
|
|
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 |
|
|
99
98
|
|
|
100
|
-
**Large Data — 100,000 rows
|
|
99
|
+
**Large Data — 100,000 rows × 20 columns (2M cells)**
|
|
101
100
|
|
|
102
|
-
|
|
|
103
|
-
| --------- |
|
|
104
|
-
|
|
|
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.84 ops/s | 0.83 ops/s | 0.90 ops/s | 0.94 ops/s | 0.39 ops/s |
|
|
107
104
|
|
|
108
105
|
## License
|
|
109
106
|
|
|
110
|
-
- [MIT](LICENSE) © [Demo Macro](https://
|
|
107
|
+
- [MIT](LICENSE) © [Demo Macro](https://www.demomacro.com/)
|