'Is there a way to combine two Excel files together using Javascript?

I am using ExcelJS npm oackage to generate my excel files in NestJS , it works fine for most part but I am unable to find a way to merge wroksheets from various workbooks in single new workbook ALONG with styling . I am able to copy the cell values but that too by an expensive opeartion like this below

 sheetLocal.eachRow({ includeEmpty: false }, (row, rowNumber) => {
    const targetRow = book.getWorksheet(sheetLocal.name).getRow(rowNumber);
    row.eachCell({ includeEmpty: false }, (cell, cellNumber) => {
      targetRow.getCell(cellNumber).value = cell.value;
    });
    row.commit();
  });

  book.getWorksheet(sheetLocal.name).model = cloneDeep(sheetLocal.model);
});

So is there any easy way to combine excel files in Javascript , like for Java it can be done using Aspose library.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source