由 Devika 出售

ExcelJS lets you read, create, and manipulate XLSX and CSV spreadsheets with full style, formula, image, and streaming support. Ideal for Node.js backends and plugins generating or processing Excel files.
This block provides the full ExcelJS 4.4.0 library source for reading, manipulating, and writing XLSX spreadsheet files, as well as CSV import/export. The typical buyer is a Node.js/TypeScript backend developer who needs programmatic spreadsheet generation, parsing, or streaming without relying on the published npm binary.
exceljs.nodejs.js - Main entry point for Node.js: wires together Workbook, ModelContainer, and streaming classesexceljs.browser.js - Browser-compatible entry point with polyfill requiresexceljs.bare.js - Entry point without polyfills, for apps supplying their owncsv/ - CSV read/write support (csv.js, line-buffer.js, stream-converter.js)doc/ - Core document model: Workbook, Worksheet, Row, Cell, Column, Image, Table, Pivot, etc.stream/ - Streaming XLSX reader/writer for large files without full in-memory loadutils/ - Internal utilities: col-cache, shared-strings, XML stream, ZIP stream, encryptor, etc.xlsx/ - XLSX serialization/deserialization engine, xform transforms, style handlingnpm install archiver dayjs fast-csv jszip readable-stream saxes tmp unzipper uuid
npm install core-js regenerator-runtime # required for browser/bare bundles
No native modules, no pod install, no Android linking, no prebuild steps required.
source/ directory into your project, e.g. at src/vendor/exceljs/.source/exceljs.nodejs.js. For browser or polyfill-free builds use exceljs.browser.js or exceljs.bare.js.tsconfig.json:
{
"compilerOptions": {
"paths": {
"exceljs-local": ["./src/vendor/exceljs/exceljs.nodejs.js"]
}
}
}
tmp package writes temp files to the OS temp dir; ensure that directory is writable when using streaming reader with large files.@types/exceljs or rely on the upstream exceljs package's bundled for editor hints (the source itself is plain JS).启动隔离沙箱并在服务器端直接运行 — 无需本地配置。
此版本的 Tetrees AI Review
This JavaScript library / package completed archive review. Structure, dependency manifests, documentation, functional source, and common risk patterns were checked by the Tetrees verification pipeline; runtime phases are stated separately.
Deterministic AVCP artifact review
管道 avcp-2026-08-04.1 · SHA-256 b4739192b4788d43…
This version-scoped review deterministically inspects the submitted archive for structure, dependencies, documentation, functional source, and common malicious or high-risk signals. Build and test phases are reported as passed only after an isolated sandbox audition. It is not a guarantee of perfect security.
审查日期 2026年8月4日
将此产品直接导入你的 AI IDE、网页构建器或云端 IDE。
将 Tetrees 连接到兼容的 AI IDE,列出你拥有的产品并获取已验证 ZIP,同时不会开放卖家上传权限。
暂无评价。
Sign in to join the discussion
Loading discussion…
.d.tsimport ExcelJS from './src/vendor/exceljs/exceljs.nodejs.js';
const workbook: ExcelJS.Workbook = new ExcelJS.Workbook();
The central object for all spreadsheet operations. Use it to create, load, and save XLSX files. All worksheets, styles, images, and defined names live on a Workbook instance.
import ExcelJS from './src/vendor/exceljs/exceljs.nodejs.js';
const writer = new ExcelJS.stream.xlsx.WorkbookWriter({ filename: 'out.xlsx' });
Streaming XLSX writer that flushes rows to disk/stream as they are written, keeping memory usage flat for large datasets. Use this instead of Workbook when generating files with tens of thousands of rows.
import ExcelJS from './src/vendor/exceljs/exceljs.nodejs.js';
const reader = new ExcelJS.stream.xlsx.WorkbookReader('./input.xlsx');
Streaming XLSX reader that emits worksheet and row events as the file is parsed. Use when consuming very large XLSX files without buffering the whole document in memory.
import ExcelJS from './src/vendor/exceljs/exceljs.nodejs.js';
const container = new ExcelJS.ModelContainer();
Wraps a workbook model for serialisation and transport. Used internally when converting between JSON model representation and the full Workbook object.
Build a workbook with a single worksheet, populate rows, and write to disk.
const ExcelJS = require('./src/vendor/exceljs/exceljs.nodejs.js');
async function createSpreadsheet() {
const workbook = new ExcelJS.Workbook();
workbook.creator = 'My App';
workbook.created = new Date();
const sheet = workbook.addWorksheet('Sales');
sheet.columns = [
{ header: 'Product', key: 'product', width: 20 },
{ header: 'Revenue', key: 'revenue', width: 15 },
{ header: 'Date', key: 'date', width: 15 },
];
sheet.addRow({ product: 'Widget A', revenue: 1200.5, date: new Date('2024-01-15') });
sheet.addRow({ product: 'Widget B', revenue: 850.0, date: new Date('2024-01-16') });
await workbook.xlsx.writeFile('output.xlsx');
console.log('Written: output.xlsx');
}
createSpreadsheet();
Load an XLSX file and iterate over every row in the first worksheet.
const ExcelJS = require('./src/vendor/exceljs/exceljs.nodejs.js');
async function readSpreadsheet(filePath: string) {
const workbook = new ExcelJS.Workbook();
await workbook.xlsx.readFile(filePath);
const sheet = workbook.getWorksheet(1);
sheet.eachRow({ includeEmpty: false }, (row, rowNumber) => {
console.log(`Row ${rowNumber}:`, row.values);
});
}
readSpreadsheet('./input.xlsx');
Use WorkbookWriter to stream tens of thousands of rows without buffering the entire workbook in memory.
const ExcelJS = require('./src/vendor/exceljs/exceljs.nodejs.js');
async function streamWrite() {
const writer = new ExcelJS.stream.xlsx.WorkbookWriter({
filename: 'large-output.xlsx',
useStyles: true,
});
const sheet = writer.addWorksheet('Data');
sheet.columns = [
{ header: 'ID', key: 'id', width: 10 },
{ header: 'Value', key: 'value', width: 20 },
];
for (let i = 0; i < 100000; i++) {
await sheet.addRow({ id: i, value: `item-${i}` }).commit();
}
await sheet.commit();
await writer.commit();
console.log('Streaming write complete.');
}
streamWrite();
Process a large XLSX file row by row using WorkbookReader without loading the whole file.
const ExcelJS = require('./src/vendor/exceljs/exceljs.nodejs.js');
async function streamRead(filePath: string) {
const reader = new ExcelJS.stream.xlsx.WorkbookReader(filePath);
for await (const worksheet of reader) {
console.log('Worksheet:', worksheet.name);
for await (const row of worksheet) {
console.log('Row:', row.values);
}
}
}
streamRead('./large-input.xlsx');
exceljs.nodejs.js - Assembles the full Node.js API surface: Workbook, ModelContainer, stream.xlsx.WorkbookWriter, stream.xlsx.WorkbookReader, and Enums.exceljs.browser.js - Browser entry; loads core-js polyfills before requiring the same Workbook and Enums, omitting Node.js streaming classes.exceljs.bare.js - Polyfill-free variant for apps that already bundle their own; exposes only Workbook and Enums.csv/ - Contains csv.js (CSV read/write coordinator), line-buffer.js (line-by-line buffering), and stream-converter.js (stream adaptor for fast-csv).doc/ - Domain model layer. workbook.js is the Workbook class; worksheet.js, row.js, cell.js, column.js represent spreadsheet structure. enums.js exports alignment, border, and font constants. table.js, pivot-table.js, image.js, note.js handle rich features.stream/xlsx/ - Streaming counterparts: workbook-writer.js and workbook-reader.js for memory-efficient large file handling; worksheet-reader.js and worksheet-writer.js for per-sheet streaming; helper writers for comments and relationships.utils/ - Low-level helpers: col-cache.js (A1/RC conversion), shared-strings.js (string table), xml-stream.js (XML generation), zip-stream.js (ZIP assembly), encryptor.js (XLSX encryption), utils.js (general helpers), string-buf.js and stream-buf.js (buffering).xlsx/ - XLSX format engine. xlsx.js orchestrates read/write. xform/ contains transform objects for every XML part (sheet, style, drawing, table, pivot-table, strings). defaultnumformats.js maps built-in number format IDs.tmp module writes to system temp: On restricted environments (Docker scratch, read-only FS) streaming reads may fail; set TMPDIR to a writable path before starting the process.require. If your project uses "type": "module" in package.json, import via createRequire or rename the entry to .cjs.exceljs.browser.js requires core-js and regenerator-runtime; install them explicitly or switch to exceljs.bare.js and add your own polyfill pipeline.archiver vs jszip for write path: The non-streaming Workbook.xlsx.writeFile uses jszip; the streaming WorkbookWriter uses archiver. Both must be installed even if you only use one path.Workbook: Loading a 50 MB XLSX with workbook.xlsx.readFile buffers the entire file. Switch to stream.xlsx.WorkbookReader for files above a few MB.\ / ? * [ ] : and must be 31 characters or fewer; the library will throw at write time, not at addWorksheet time.I have the ExcelJS 4.4.0 library source code in `source/` and its integration
guide in `USAGE.md`. The upstream package is `user@example.com`.
Please help me integrate this into my existing Node.js/TypeScript project:
1. Read `USAGE.md` fully before writing any code.
2. Copy `source/` to `src/vendor/exceljs/` and wire the path alias in
`tsconfig.json` as shown in USAGE.md § Project setup.
3. Install all dependencies listed in USAGE.md § Required dependencies.
4. In my Express route `src/routes/export.ts`, add a POST handler that:
- Accepts a JSON body `{ rows: Array<{ id: number; label: string }> }`
- Uses `ExcelJS.Workbook` (from `exceljs.nodejs.js`) to build an XLSX
- Streams the file back to the client with content-type
`application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`
5. Add a second route that uses `stream.xlsx.WorkbookWriter` for large exports.
6. Show only real imports from the file excerpts in USAGE.md; do not invent
any API not shown there.
7. Walk me through each step before writing code, then produce the final files.
ExcelJS is published under the MIT License. See source/LICENSE if present, or refer to the upstream repository. Upstream package: exceljs on npm / github.com/exceljs/exceljs.
This product’s unique contribution is clean room implementation of valuable code block into AVCP compatible standard.
完整安装指南与集成提示词将在购买后解锁。
Automation, Utilities & Developer Tools
免费