@bilig/xlsx-formula-recalc 0.129.1 → 0.130.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.
Files changed (2) hide show
  1. package/README.md +26 -0
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -27,6 +27,7 @@ Expected shape:
27
27
 
28
28
  ```json
29
29
  {
30
+ "schemaVersion": "xlsx-cache-doctor.v1",
30
31
  "formulaCellCount": 1,
31
32
  "inspectedFormulaCellCount": 1,
32
33
  "uninspectedFormulaCellCount": 0,
@@ -128,6 +129,7 @@ the JSON includes the skipped count as `uninspectedFormulaCellCount`.
128
129
 
129
130
  ```json
130
131
  {
132
+ "schemaVersion": "xlsx-cache-doctor.v1",
131
133
  "formulaCellCount": 12,
132
134
  "inspectedFormulaCellCount": 12,
133
135
  "uninspectedFormulaCellCount": 0,
@@ -219,6 +221,30 @@ run
219
221
 
220
222
  ## API
221
223
 
224
+ Use `inspectXlsxCache` when a service or test runner needs the cache-doctor
225
+ report without shelling out to the CLI:
226
+
227
+ ```ts
228
+ import { readFile } from 'node:fs/promises'
229
+ import { inspectXlsxCache } from '@bilig/xlsx-formula-recalc'
230
+
231
+ const report = inspectXlsxCache(await readFile('pricing.xlsx'), {
232
+ fileName: 'pricing.xlsx',
233
+ })
234
+
235
+ if (report.staleCachedFormulaCount > 0) {
236
+ throw new Error(
237
+ report.formulas
238
+ .filter((formula) => formula.cacheStatus === 'stale')
239
+ .map((formula) => formula.target)
240
+ .join(', '),
241
+ )
242
+ }
243
+ ```
244
+
245
+ The API returns the same `schemaVersion`, `cacheStatusSummary`, per-formula
246
+ `cacheStatus`, and `suggestedReads` fields as the JSON CLI report.
247
+
222
248
  ```ts
223
249
  import { recalculateXlsx } from '@bilig/xlsx-formula-recalc'
224
250
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bilig/xlsx-formula-recalc",
3
- "version": "0.129.1",
3
+ "version": "0.130.0",
4
4
  "description": "Diagnose stale cached XLSX formula values and recalculate XLSX formulas in Node.js without Excel, LibreOffice, or browser automation.",
5
5
  "keywords": [
6
6
  "bilig",
@@ -71,7 +71,7 @@
71
71
  "smoke": "node ./dist/cli.js --help"
72
72
  },
73
73
  "dependencies": {
74
- "xlsx-formula-recalc": "0.129.1"
74
+ "xlsx-formula-recalc": "0.130.0"
75
75
  },
76
76
  "engines": {
77
77
  "node": ">=22.0.0"