Prototype pollution
Parser and conversion paths reject or ignore
__proto__, prototype and
constructor where untrusted input can become an object
key.
Stackline spreadsheet package
A maintained fork for applications that need a practical replacement
path for xlsx while preserving the familiar workbook API.
Install
npm install @stackline/xlsx
Existing apps that must keep
import * as XLSX from 'xlsx' can use npm alias migration.
npm install xlsx@npm:@stackline/xlsx
Usage
import * as XLSX from '@stackline/xlsx';
export function parseWorkbook(file: ArrayBuffer) {
const workbook = XLSX.read(file, { type: 'array' });
const sheetName = workbook.SheetNames[0];
return XLSX.utils.sheet_to_json(workbook.Sheets[sheetName], {
defval: null
});
}
Write
const worksheet = XLSX.utils.json_to_sheet([
{ name: 'Ada', role: 'Engineer' },
{ name: 'Grace', role: 'Reviewer' }
]);
const workbook = XLSX.utils.book_new();
XLSX.utils.book_append_sheet(workbook, worksheet, 'People');
Security
Parser and conversion paths reject or ignore
__proto__, prototype and
constructor where untrusted input can become an object
key.
The package keeps the upstream regular expression hardening and adds malformed input regression coverage.
Tests cover XLSX, ODS, XLS, XLML, relationships, custom properties and JSON headers with malicious keys.
Formats
| Format family | Read | Write | Notes |
|---|---|---|---|
| XLSX / XLSM / XLSB | Yes | Yes | Modern Excel workbook formats |
| XLS | Yes | Yes | Legacy Excel workbook format |
| ODS / FODS | Yes | Yes | OpenDocument spreadsheet formats |
| CSV / TSV / TXT | Yes | Yes | Plaintext tabular data |
| HTML tables | Yes | Yes | Table import and export helpers |
| DBF / SYLK / DIF | Yes | Yes | Legacy interchange formats |
Release
@stackline/[email protected] on npm.npm ci.npm test.npm run build.make dist.npm pack --dry-run.Text-first files for AI coding assistants, search engines, audits, and fast adoption guidance.