json-to-excel

json to excel for download

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
json-to-excel
101.0.17 years ago8 years agoMinified + gzip package size for json-to-excel in KB

Readme

json-to-excel
fork from rikkertkoppes/json2xls
Different
  • cols add width property
  • delete express middleware cause i use koajs
Usage
Download the json data as excel file.
var router = require('koa-router')();
router.get('/download', function* (){
    var xls = json2xls(results);
    this.type = 'application/vnd.openxmlformats';
    this.set('Content-Type', 'application/vnd.openxmlformats');
    this.set("Content-Disposition", "attachment; filename= download-json-to-excel.xlsx");
    var buffer = new Buffer(xls,'binary');
    this.body = buffer;
});