The type of the data that will be written to the Excel file.
The path where the Excel file will be written.
An object where each key is a worksheet name and the corresponding value is a 2D array of data to be written to that worksheet.
A Promise that resolves when the file has been written.
This function creates a new Excel file or overwrites an existing one. Each key in the data object will be used as a worksheet name, and the corresponding 2D array will be written to that worksheet.
If there is an error writing the file.
await writeExcelFile('path/to/file.xlsx', {
employees: [
['Name', 'Age', 'Title'],
['John', 30, 'Software Developer'],
['Jane', 28, 'Data Scientist'],
],
locations: [
['ID', 'Country', 'City'],
[1, 'DK', 'Aarhus'],
[2, 'DK', 'Copenhagen'],
],
})
Generated using TypeDoc
Write multiple tables to an Excel file as worksheets.