# koa-json2xlsx

> json2xlsx middleware for koa.

Latest version **1.0.3** (published 2019-03-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install koa-json2xlsx
pnpm add koa-json2xlsx
yarn add koa-json2xlsx
bun add koa-json2xlsx
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2019-03-05 |
| First published | 2018-02-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 4.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | NoobTW |
| Maintainers | noobtw |
| Keywords | koa, json2xls, json2xlsx |

## Links

- npm: https://www.npmjs.com/package/koa-json2xlsx
- Repository: https://github.com/NoobTW/koa-json2xlsx
- Homepage: https://github.com/NoobTW/koa-json2xlsx#readme
- Issues: https://github.com/NoobTW/koa-json2xlsx/issues
- npm.io page: https://npm.io/package/koa-json2xlsx

## Dependencies (1)

- [json2xls](https://npm.io/package/json2xls.md) ^0.1.2

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 1.0.3 (latest) — 2019-03-05
- 1.0.2 — 2018-02-18
- 1.0.0 — 2018-02-18

## README

# koa-json2xlsx

![Build status](https://travis-ci.org/NoobTW/koa-json2xlsx.svg?branch=master) ![Node version](https://img.shields.io/badge/node-%3E%3D_7.6.0-green.svg)

> Json to excel(xlsx) middleware for [koa](https://github.com/koajs/koa)

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

## Installation

Install using [npm](https://www.npmjs.com):
```bash
npm install koa-json2xlsx
```

## Usage
```javascript
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](https://github.com/rikkertkoppes/json2xls#options).

#### xls

An alias of `xlsx`.

## Tests

Run tests using `npm test`.

---
_Source: https://npm.io/package/koa-json2xlsx · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
