exceljs-formula-recalc 0.33.1 → 0.34.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/AGENTS.md ADDED
@@ -0,0 +1,35 @@
1
+ # exceljs-formula-recalc Agent Notes
2
+
3
+ Use this package when a Node.js task already uses ExcelJS for workbook I/O but
4
+ needs recalculated formula values after editing inputs.
5
+
6
+ Start with the one-command proof:
7
+
8
+ ```sh
9
+ npx --package exceljs-formula-recalc exceljs-recalc --demo --json
10
+ ```
11
+
12
+ For a workbook that ExcelJS already wrote to disk:
13
+
14
+ ```sh
15
+ npx --package exceljs-formula-recalc exceljs-recalc quote.xlsx \
16
+ --set Inputs!B2=48 \
17
+ --read Summary!B7 \
18
+ --out quote.recalculated.xlsx \
19
+ --json
20
+ ```
21
+
22
+ Use the API when code needs the in-memory ExcelJS workbook patched:
23
+
24
+ ```ts
25
+ import { recalculateExceljsWorkbook } from 'exceljs-formula-recalc'
26
+
27
+ const result = await recalculateExceljsWorkbook(workbook, {
28
+ edits: [{ target: 'Inputs!B2', value: 48 }],
29
+ reads: ['Summary!B7'],
30
+ })
31
+ ```
32
+
33
+ ExcelJS stores formula text and cached results; it does not recalculate the
34
+ workbook by itself. Treat unsupported functions, external links, macros, and
35
+ volatile formulas as fixture candidates before promising production behavior.
package/README.md CHANGED
@@ -10,6 +10,29 @@ ExcelJS can read and write formula cells, but it does not run an Excel-compatibl
10
10
  npm install exceljs exceljs-formula-recalc
11
11
  ```
12
12
 
13
+ ## CLI
14
+
15
+ If your ExcelJS workflow has already written an `.xlsx` file, the package also
16
+ ships an ExcelJS-named CLI for quick proof runs:
17
+
18
+ ```sh
19
+ npx --package exceljs-formula-recalc exceljs-recalc --demo --json
20
+ ```
21
+
22
+ For a real workbook saved by ExcelJS:
23
+
24
+ ```sh
25
+ npx --package exceljs-formula-recalc exceljs-recalc quote.xlsx \
26
+ --set Inputs!B2=48 \
27
+ --set Inputs!B3=1500 \
28
+ --read Summary!B7 \
29
+ --out quote.recalculated.xlsx \
30
+ --json
31
+ ```
32
+
33
+ Use the API below when backend code needs the recalculated values patched back
34
+ onto the in-memory ExcelJS workbook object.
35
+
13
36
  ## Use With ExcelJS
14
37
 
15
38
  ```ts
package/SKILL.md ADDED
@@ -0,0 +1,36 @@
1
+ # ExcelJS Formula Recalculation
2
+
3
+ Use `exceljs-formula-recalc` when an agent or Node.js service already uses
4
+ ExcelJS and needs fresh formula output values after changing cells.
5
+
6
+ ## First Check
7
+
8
+ ```sh
9
+ npx --package exceljs-formula-recalc exceljs-recalc --demo --json
10
+ ```
11
+
12
+ The demo should print `verified: true` and a `Summary!B2` value of `72000`.
13
+
14
+ ## Real Workbook
15
+
16
+ ```sh
17
+ npx --package exceljs-formula-recalc exceljs-recalc workbook.xlsx \
18
+ --set Inputs!B2=48 \
19
+ --read Summary!B7 \
20
+ --out workbook.recalculated.xlsx \
21
+ --json
22
+ ```
23
+
24
+ ## TypeScript
25
+
26
+ ```ts
27
+ import { recalculateExceljsWorkbook } from 'exceljs-formula-recalc'
28
+
29
+ const result = await recalculateExceljsWorkbook(workbook, {
30
+ edits: [{ target: 'Inputs!B2', value: 48 }],
31
+ reads: ['Summary!B7'],
32
+ })
33
+ ```
34
+
35
+ Use `xlsx-formula-recalc` instead when the caller only has raw XLSX bytes and
36
+ does not need an ExcelJS workbook object.
package/dist/cli.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
package/dist/cli.js ADDED
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env node
2
+ import { runXlsxFormulaRecalcCli } from 'xlsx-formula-recalc/cli-api';
3
+ process.exitCode = runXlsxFormulaRecalcCli(process.argv.slice(2), {
4
+ commandName: 'exceljs-recalc',
5
+ });
6
+ //# sourceMappingURL=cli.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAA;AAErE,OAAO,CAAC,QAAQ,GAAG,uBAAuB,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE;IAChE,WAAW,EAAE,gBAAgB;CAC9B,CAAC,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "exceljs-formula-recalc",
3
- "version": "0.33.1",
3
+ "version": "0.34.0",
4
4
  "description": "Recalculate ExcelJS XLSX workbook formulas in Node.js without Excel, LibreOffice, or browser automation.",
5
5
  "keywords": [
6
6
  "excel",
@@ -28,8 +28,13 @@
28
28
  "url": "git+https://github.com/proompteng/bilig.git",
29
29
  "directory": "packages/exceljs-formula-recalc"
30
30
  },
31
+ "bin": {
32
+ "exceljs-recalc": "./dist/cli.js"
33
+ },
31
34
  "files": [
32
35
  "dist",
36
+ "AGENTS.md",
37
+ "SKILL.md",
33
38
  "README.md",
34
39
  "LICENSE"
35
40
  ],
@@ -50,7 +55,7 @@
50
55
  "build": "pnpm --dir ../.. --filter xlsx-formula-recalc build && rm -rf dist tsconfig.tsbuildinfo && tsc -p tsconfig.json"
51
56
  },
52
57
  "dependencies": {
53
- "xlsx-formula-recalc": "0.33.1"
58
+ "xlsx-formula-recalc": "0.34.0"
54
59
  },
55
60
  "devDependencies": {
56
61
  "exceljs": "4.4.0"