@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 +18 -21
- package/dist/context-a1lzscdy.mjs +2251 -0
- package/dist/context-a1lzscdy.mjs.map +1 -0
- package/dist/generate-BLESQtfS.d.mts +26 -0
- package/dist/generate-BLESQtfS.d.mts.map +1 -0
- package/dist/generate-CmgPdwPP.mjs +2786 -0
- package/dist/generate-CmgPdwPP.mjs.map +1 -0
- package/dist/generate.d.mts +2 -0
- package/dist/generate.mjs +2 -0
- package/dist/index.d.mts +536 -1971
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +7 -5138
- 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 +131 -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,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 |
|
|
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 | 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
|
|
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.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://
|
|
107
|
+
- [MIT](LICENSE) © [Demo Macro](https://www.demomacro.com/)
|