@niicojs/excel 0.3.4 → 0.3.6
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/LICENSE +20 -20
- package/README.md +8 -2
- package/dist/index.cjs +1191 -1266
- package/dist/index.d.cts +171 -324
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +171 -324
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1191 -1267
- package/package.json +4 -4
- package/src/index.ts +8 -10
- package/src/pivot-table.ts +619 -524
- package/src/shared-strings.ts +33 -9
- package/src/styles.ts +38 -9
- package/src/types.ts +295 -323
- package/src/utils/address.ts +48 -0
- package/src/utils/format.ts +8 -7
- package/src/utils/xml.ts +7 -4
- package/src/utils/zip.ts +153 -11
- package/src/workbook.ts +330 -350
- package/src/worksheet.ts +1003 -935
- package/src/pivot-cache.ts +0 -449
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 niico
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 niico
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
21
|
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -61,13 +61,16 @@ await wb.toFile('output.xlsx');
|
|
|
61
61
|
```typescript
|
|
62
62
|
import { Workbook } from '@niicojs/excel';
|
|
63
63
|
|
|
64
|
-
// Load from file
|
|
64
|
+
// Load from file (lazy parsing is enabled by default)
|
|
65
65
|
const wb = await Workbook.fromFile('template.xlsx');
|
|
66
66
|
|
|
67
67
|
// Or load from buffer
|
|
68
68
|
const buffer = await fetch('https://example.com/file.xlsx').then((r) => r.arrayBuffer());
|
|
69
69
|
const wb = await Workbook.fromBuffer(new Uint8Array(buffer));
|
|
70
70
|
|
|
71
|
+
// Disable lazy parsing if you want eager loading
|
|
72
|
+
const eager = await Workbook.fromFile('template.xlsx', { lazy: false });
|
|
73
|
+
|
|
71
74
|
// Read data
|
|
72
75
|
const sheet = wb.sheet('Sheet1');
|
|
73
76
|
console.log(sheet.cell('A1').value); // The cell value
|
|
@@ -425,13 +428,16 @@ const readData = sheet.toJson();
|
|
|
425
428
|
## Saving
|
|
426
429
|
|
|
427
430
|
```typescript
|
|
428
|
-
// Load from file
|
|
431
|
+
// Load from file (lazy parsing is enabled by default)
|
|
429
432
|
const wb = await Workbook.fromFile('template.xlsx');
|
|
430
433
|
|
|
431
434
|
// Or load from buffer
|
|
432
435
|
const buffer = await fetch('https://example.com/file.xlsx').then((r) => r.arrayBuffer());
|
|
433
436
|
const wb2 = await Workbook.fromBuffer(new Uint8Array(buffer));
|
|
434
437
|
|
|
438
|
+
// Disable lazy parsing if you want eager loading
|
|
439
|
+
const eager = await Workbook.fromFile('template.xlsx', { lazy: false });
|
|
440
|
+
|
|
435
441
|
// Read data
|
|
436
442
|
const sheet = wb.sheet('Sheet1');
|
|
437
443
|
console.log(sheet.cell('A1').value); // The cell value
|