Export the Excel plug-in with format msexcel-builder,
MSExcel generator (msexcel-builder)
A small library is used to create Nodejs under the Microsoft Office Excel (2007) file.
A simple and quick library to create an Office Excel (> 2007) xlsx file (compatible with the OpenOffice document format ).
Features:
Supports workbooks with multiple worksheets.
Customize the column width and row height, and merge cells.
Customize the cell style (such as the background color ).
Customize the cell border style (such as thin and medium ).
Customize the font style of cells (such as font and bold ).
Customize cell border styles and merged cells.
First, install node. js.
Then install it in node. js:
npm install msexcel-builder
Create a workbook with data.
// Create a new workbook file in current working-path var workbook = excelbuilder.createWorkbook('./', 'sample.xlsx') // Create a new worksheet with 10 columns and 12 rows var sheet1 = workbook.createSheet('sheet1', 10, 12); // Fill some data sheet1.set(1, 1, 'I am title'); for (var i = 2; i < 5; i++) sheet1.set(i, 1, 'test'+i); // Save it workbook.save(function(ok){ if (!ok) workbook.cancel(); else console.log('congratulations, your workbook created'); });
Link: https://www.npmjs.com/package/msexcel-builder