Skip to content

qixin1991/json-to-excel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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;
    });

About

json to excel for download by nodejs.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published