@oniryk/xlsx
Version:
A lightweight, efficient TypeScript library for generating single-sheet Excel XLSX files with support for large datasets
24 lines (23 loc) • 823 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.build = build;
const packing_js_1 = require("./packing.js");
/**
* Creates an Excel XLSX file from the provided sheet and shared strings
* Convenience function that wraps the Package class functionality
*
* @param sheet - Sheet instance containing the worksheet data
* @param strings - SharedStrings instance managing text content
* @returns Promise that resolves to the XLSX file as a Buffer
*
* @example
* const strings = new SharedStrings();
* const sheet = new Sheet(strings);
* sheet.addRow(['Name', 'Age']);
* sheet.addRow(['John', 25]);
* const buffer = await build(sheet, strings);
*/
async function build(sheet, strings) {
const pack = new packing_js_1.Package(sheet, strings);
return await pack.build();
}