Skip to content

NoobTW/koa-json2xlsx

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

koa-json2xlsx

Build status Node version

Json to excel(xlsx) middleware for koa

Need async/await support, so you have to use Node v7.6+, or use --harmony option.

Installation

Install using npm:

npm install koa-json2xlsx

Usage

const Koa = require('koa');
const koaJson2xlsx = require('koa-json2xlsx');

const app = new Koa();
const data = [
  {
    name: 'Peter',
    age: 18,
    foo: 'bar'
  },
  {
    name: 'Jane',
    age: 19,
    foo: 'bar'
  }
];

app.use(koaJson2xlsx());
app.use(ctx => {
  ctx.xlsx('data.xlsx', data);
});

Reference

xlsx

ctx.xlsx(filename, [option])

You can find available option here.

xls

An alias of xlsx.

Tests

Run tests using npm test.

About

Json to excel(xlsx) middleware for koa.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published