Created
May 27, 2018 12:17
-
-
Save adilsoncarvalho/e10476b853187b441b83e6635d0f701b to your computer and use it in GitHub Desktop.
Creating a xlsx file using the package xlsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// More at: https://github.com/SheetJS/js-xlsx/blob/master/demos/server/express.js | |
import XLSX from 'xlsx'; | |
// create a new workbook | |
const workbook = XLSX.utils.book_new(); | |
// create a new worksheet | |
const worksheet = XSLX.utils.json_to_sheet([{ a: 1, b: false }]); | |
// add the worksheet to the workbook | |
XLSX.utils.book_append_sheet(workbook, worksheet, 'Teretete'); | |
// write it down | |
XLSX.writeFile(workbook, 'out.xlsx'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment