{"_id":"@anyfile/excel","name":"@anyfile/excel","dist-tags":{"latest":"0.3.0"},"versions":{"0.3.0":{"name":"@anyfile/excel","version":"0.3.0","description":"Excel handler for the AnyFile ecosystem.","main":"dist/index.cjs","module":"dist/index.mjs","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.mjs","require":"./dist/index.cjs","types":"./dist/index.d.ts"}},"type":"module","scripts":{"build":"tsc --build tsconfig.declarations.json --force && tsup src/index.ts --format cjs,esm --tsconfig tsconfig.json","clean":"rimraf dist","lint":"eslint \"src/**/*.ts\"","test":"vitest run"},"keywords":["anyfile","excel","xlsx","spreadsheet","typescript"],"author":"","license":"MIT","peerDependencies":{"@anyfile/core":"^0.1.1"},"dependencies":{"@anyfile/core":"^0.1.1","xlsx":"^0.18.5","xlsx-calc":"^0.9.2","jszip":"^3.10.1"},"devDependencies":{"rimraf":"^5.0.5"},"_id":"@anyfile/excel@0.3.0","gitHead":"206c2437fe97cca57641aa31213438948ffdf33f","_nodeVersion":"22.21.0","_npmVersion":"10.9.4","dist":{"integrity":"sha512-RQugGqVrbQUAM5Muc7XufN5X9np/TMurtjVqpBHYCpanwSPoKNz3HubRN+QG4qvpZiqRcMdlj1WdS8eGy0QUrA==","shasum":"c910bd6e8e6dbc75877fe27a7e63b780336feeec","tarball":"https://registry.npmjs.org/@anyfile/excel/-/excel-0.3.0.tgz","fileCount":10,"unpackedSize":92795,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCGQElZIdSv1n6KGZ9cJdEc3pam44XiOFWs8zOjgf6wQgIhAOaaIKPDpw72gtx1DyVycTMbzdIJZZbI+Rtj95JqbVtB"}]},"_npmUser":{"name":"abrshef27","email":"abrshefru1427@gmail.com"},"directories":{},"maintainers":[{"name":"abrshef27","email":"abrshefru1427@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/excel_0.3.0_1763076109428_0.8426505025184623"},"_hasShrinkwrap":false}},"time":{"created":"2025-11-13T23:21:49.352Z","0.3.0":"2025-11-13T23:21:49.638Z","modified":"2025-11-13T23:21:49.909Z"},"maintainers":[{"name":"abrshef27","email":"abrshefru1427@gmail.com"}],"description":"Excel handler for the AnyFile ecosystem.","keywords":["anyfile","excel","xlsx","spreadsheet","typescript"],"license":"MIT","readme":"# @anyfile/excel\r\n\r\nExcel handler for the AnyFile ecosystem. This package plugs into `@anyfile/core` and registers spreadsheet support (XLSX, XLSM, XLSB, XLS) with a consistent API.\r\n\r\n## Installation\r\n\r\n```bash\r\npnpm add @anyfile/core @anyfile/excel\r\n# or\r\nnpm install @anyfile/core @anyfile/excel\r\n```\r\n\r\n## Usage\r\n\r\nImporting the package registers the handler automatically:\r\n\r\n```ts\r\nimport \"@anyfile/excel\";\r\nimport { AnyFile } from \"@anyfile/core\";\r\n\r\nconst file = await AnyFile.open(\"./report.xlsx\");\r\nconst workbook = await file.read();\r\nconst rows = await workbook.readSheet(\"Sheet1\");\r\n\r\nawait file.write(\"./report-final.xlsx\", workbook);\r\n```\r\n\r\nYou can also use the module-specific helper:\r\n\r\n```ts\r\nimport { Excel } from \"@anyfile/excel\";\r\n\r\nconst workbook = await Excel.open(\"./report.xlsx\");\r\nconst totals = await workbook.readSheet(\"Totals\");\r\n\r\n// Sheet helpers\r\nconst sheets = workbook.getSheetNames();\r\nconst metadata = workbook.getMetadata();\r\nworkbook.addSheetFromCSV(\"Imported\", \"Col1,Col2\\n1,2\\n3,4\");\r\n\r\n// Cell helpers\r\nconst cell = workbook.getCell(\"Totals\", 2, 3);\r\nworkbook.setCell(\"Totals\", 5, 1, \"Grand Total\", {\r\n  style: {\r\n    bold: true,\r\n    fontColor: \"#0B5FFF\",\r\n    backgroundColor: \"#E8F1FF\",\r\n    numberFormat: \"$#,##0.00\",\r\n  },\r\n});\r\n\r\n// Formulas\r\nExcel.registerFormula(\"DOUBLE\", (value) => Number(value) * 2);\r\nworkbook.setCell(\"Totals\", 10, 2, null, { formula: \"A10+B10\" });\r\nconst result = workbook.evaluateCell(\"Totals\", 10, 2);\r\nconsole.log(result.evaluatedValue);\r\n\r\nconst report = workbook.evaluateAll({ ignoreCircular: true });\r\nconsole.log(report.circular.length);\r\n\r\nconst circular = workbook.findCircularReferences();\r\nif (circular.length > 0) {\r\n  console.warn(\"Circular formula detected\", circular);\r\n}\r\n\r\nconst summary = workbook.getFormulaSummary();\r\nconsole.log(summary.customFormulas);\r\n\r\n// CSV export\r\nconst csv = workbook.toCSV(\"Totals\");\r\n\r\nawait workbook.write(\"./report.xlsx\", workbook);\r\n```\r\n\r\n## Features\r\n\r\n- Detects Excel files by extension or signature.\r\n- Reads workbook metadata, sheet descriptors, and row data.\r\n- Sheet management helpers (list/add/delete/import CSV tabs).\r\n- Cell-level read/write helpers with 1-based coordinates, styling options, and formula authoring/evaluation.\r\n- Formula evaluation (`evaluateCell`, `evaluateAll`, `getFormulaSummary`) plus circular reference detection utilities.\r\n- Custom formula registry (`registerFormula`, `registerFormulas`) and localization helpers.\r\n- Writes workbooks to disk with automatic format detection.\r\n- CSV export/import and `convert(\"csv\")` integration with `AnyFile`.\r\n- Seamlessly integrates with the `AnyFile` registry and conversion roadmap.\r\n\r\n## Status\r\n\r\n- **v0.2.0**: XLSX read/write, registry integration, sheet & cell helpers, CSV export/import.\r\n- Upcoming releases will add styling, formula evaluation, charts/images, and PDF conversion.\r\n\r\n","readmeFilename":"README.md","_rev":"1-3f9f7d338137082f8b4bb73b93912f72"}