Skip to content

Commit c071b25

Browse files
Copilotpelikhan
andcommitted
Add documentation and finalize XLSX package separation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
1 parent 8ad8c88 commit c071b25

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

packages/xlsx/README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# GenAIScript XLSX Package
2+
3+
This package contains Excel spreadsheet (XLSX) processing functionality for GenAIScript, separated from the core runtime package to isolate Excel processing dependencies.
4+
5+
## Purpose
6+
7+
This package was created to:
8+
9+
1. **Remove external CDN dependency**: The core package previously depended on `xlsx` from `https://cdn.sheetjs.com/xlsx-0.20.2/xlsx-0.20.2.tgz`, which could cause installation issues when the CDN was unavailable.
10+
11+
2. **Isolate Excel functionality**: By moving XLSX processing to a separate package, the core runtime is lighter and doesn't include Excel-specific dependencies unless needed.
12+
13+
3. **Use standard npm packages**: This package uses the standard npm `xlsx` package instead of CDN-hosted versions.
14+
15+
## API
16+
17+
The package exports the following functions:
18+
19+
- `XLSXParse(data: Uint8Array, options?: ParseXLSXOptions): Promise<WorkbookSheet[]>` - Parses XLSX data into workbook sheets
20+
- `XLSXTryParse(data: Uint8Array, options?: ParseXLSXOptions): Promise<WorkbookSheet[]>` - Same as XLSXParse but returns empty array on failure
21+
22+
## Types
23+
24+
- `ParseXLSXOptions` - Options for parsing XLSX files (sheet name, range)
25+
- `WorkbookSheet` - Represents a worksheet with name and rows
26+
27+
## Usage
28+
29+
This package is used internally by the GenAIScript core package and is not intended for direct consumption by end users.
30+
31+
## Security Note
32+
33+
The npm `xlsx` package has known vulnerabilities that are fixed in versions > 0.20.2, but these versions are only available via CDN, not npm. This is a limitation of the npm package ecosystem. The vulnerabilities are related to ReDoS and prototype pollution, but the usage within GenAIScript is controlled and limited to parsing trusted files.

0 commit comments

Comments
 (0)