exceljs-formula-recalc 0.31.1 → 0.32.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 +11 -14
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -13,22 +13,22 @@ npm install exceljs exceljs-formula-recalc
|
|
|
13
13
|
## Use With ExcelJS
|
|
14
14
|
|
|
15
15
|
```ts
|
|
16
|
-
import ExcelJS from
|
|
17
|
-
import { recalculateExceljsWorkbook } from
|
|
16
|
+
import ExcelJS from 'exceljs'
|
|
17
|
+
import { recalculateExceljsWorkbook } from 'exceljs-formula-recalc'
|
|
18
18
|
|
|
19
|
-
const workbook = new ExcelJS.Workbook()
|
|
20
|
-
await workbook.xlsx.readFile(
|
|
19
|
+
const workbook = new ExcelJS.Workbook()
|
|
20
|
+
await workbook.xlsx.readFile('quote.xlsx')
|
|
21
21
|
|
|
22
22
|
const result = await recalculateExceljsWorkbook(workbook, {
|
|
23
23
|
edits: [
|
|
24
|
-
{ target:
|
|
25
|
-
{ target:
|
|
24
|
+
{ target: 'Inputs!B2', value: 48 },
|
|
25
|
+
{ target: 'Inputs!B3', value: 1500 },
|
|
26
26
|
],
|
|
27
|
-
reads: [
|
|
28
|
-
})
|
|
27
|
+
reads: ['Summary!B7'],
|
|
28
|
+
})
|
|
29
29
|
|
|
30
|
-
console.log(result.reads[
|
|
31
|
-
await workbook.xlsx.writeFile(
|
|
30
|
+
console.log(result.reads['Summary!B7'])
|
|
31
|
+
await workbook.xlsx.writeFile('quote.recalculated.xlsx')
|
|
32
32
|
```
|
|
33
33
|
|
|
34
34
|
By default, `recalculateExceljsWorkbook` mutates the provided ExcelJS workbook by loading the recalculated XLSX bytes back into it. For targets listed in `reads`, it also patches the ExcelJS formula cell object with the recalculated `result`, so backend code can inspect proof values without reopening the file. Pass `mutateWorkbook: false` if you only need the returned `xlsx` bytes.
|
|
@@ -36,10 +36,7 @@ By default, `recalculateExceljsWorkbook` mutates the provided ExcelJS workbook b
|
|
|
36
36
|
## API
|
|
37
37
|
|
|
38
38
|
```ts
|
|
39
|
-
import {
|
|
40
|
-
recalculateExceljsBuffer,
|
|
41
|
-
recalculateExceljsWorkbook,
|
|
42
|
-
} from "exceljs-formula-recalc";
|
|
39
|
+
import { recalculateExceljsBuffer, recalculateExceljsWorkbook } from 'exceljs-formula-recalc'
|
|
43
40
|
```
|
|
44
41
|
|
|
45
42
|
`recalculateExceljsWorkbook(workbook, options)` accepts any workbook-like object with `workbook.xlsx.writeBuffer()` and `workbook.xlsx.load(...)`, which matches ExcelJS workbooks.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "exceljs-formula-recalc",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.32.1",
|
|
4
4
|
"description": "Recalculate ExcelJS XLSX workbook formulas in Node.js without Excel, LibreOffice, or browser automation.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"excel",
|
|
@@ -46,11 +46,8 @@
|
|
|
46
46
|
"publishConfig": {
|
|
47
47
|
"access": "public"
|
|
48
48
|
},
|
|
49
|
-
"scripts": {
|
|
50
|
-
"build": "pnpm --dir ../.. --filter xlsx-formula-recalc build && rm -rf dist tsconfig.tsbuildinfo && tsc -p tsconfig.json"
|
|
51
|
-
},
|
|
52
49
|
"dependencies": {
|
|
53
|
-
"xlsx-formula-recalc": "0.
|
|
50
|
+
"xlsx-formula-recalc": "0.32.1"
|
|
54
51
|
},
|
|
55
52
|
"devDependencies": {
|
|
56
53
|
"exceljs": "4.4.0"
|
|
@@ -65,5 +62,8 @@
|
|
|
65
62
|
},
|
|
66
63
|
"engines": {
|
|
67
64
|
"node": ">=22.0.0"
|
|
65
|
+
},
|
|
66
|
+
"scripts": {
|
|
67
|
+
"build": "pnpm --dir ../.. --filter xlsx-formula-recalc build && rm -rf dist tsconfig.tsbuildinfo && tsc -p tsconfig.json"
|
|
68
68
|
}
|
|
69
|
-
}
|
|
69
|
+
}
|