1.0.1 • Published 6 years ago

xlsxfromjson v1.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

xlsxfromjson

Lightweight JSON to xlsx creation in browser. Fork of zipcelx. This version supports adding multiple sheets.

Example Use

import xlsxfromjson from 'xlsxfromjson';


function createExcelFile() {
  const config = {
    filename: 'Test',
    sheets: {
      sheet1: {
        data: [
          [{
            value: 'Income - Webshop',
            type: 'string'
          }, {
            value: 1000,
            type: 'number'
          }]
        ],
        sheetName: 'Test Sheet'
      },
      sheet2: {
        data: [
          [{
            value: 'Income - Webshop2',
            type: 'string'
          }, {
            value: 2000,
            type: 'number'
          }]
        ],
        sheetName: 'Test Sheet2'
      }
      
    }
  };
  xlsxfromjson(config);
}

export default createExcelFile;