# @zjcdaniel/json-to-xlsx

> [![Version](https://img.shields.io/npm/v/json-to-xlsx.svg)](https://www.npmjs.com/package/json-to-xlsx) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](#)

Latest version **0.0.1** (published 2019-12-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install @zjcdaniel/json-to-xlsx
pnpm add @zjcdaniel/json-to-xlsx
yarn add @zjcdaniel/json-to-xlsx
bun add @zjcdaniel/json-to-xlsx
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2019-12-05 |
| First published | 2019-12-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 266.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | render |
| Maintainers | zjcdaniel |

## Links

- npm: https://www.npmjs.com/package/@zjcdaniel/json-to-xlsx
- Repository: https://github.com/zjcrender/json-to-xlsx
- Homepage: https://github.com/zjcrender/json-to-xlsx#readme
- Issues: https://github.com/zjcrender/json-to-xlsx/issues
- npm.io page: https://npm.io/package/@zjcdaniel/json-to-xlsx

## Dependencies (2)

- [file-saver](https://npm.io/package/file-saver.md) ^2.0.2
- [better-xlsx](https://npm.io/package/better-xlsx.md) ^0.7.4

## Recent versions

- 0.0.1 (latest) — 2019-12-05

## README

# Welcome to json-to-xlsx 👋
[![Version](https://img.shields.io/npm/v/json-to-xlsx.svg)](https://www.npmjs.com/package/json-to-xlsx)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](#)

### 🏠 [Homepage](https://github.com/zjcrender/json-to-xlsx)

## Install

```sh
npm install json-to-xlsx
```

## Usage
```javascript
import json2xlsx from "json-to-xlsx";

const mock = [
  {name: 'Alice', age: 16, gender: 'female', score: 95},
  {name: 'Bob', age: 18, gender: 'male', score: 83},
  // ...
]

json2xlsx({
  filename: 'example',
  data: mock,
  headers: ['name', 'age', 'gender', 'score', 'grade'],
  format: {
    grade: (row, key) => row.score > 90 ? 'A' : 'B' // just a example
  }
})
```

this will make `example.xlsx`

| | A | B | C | D | E |
|----|----|----|----|----|----|
| 1 | name | age | gender | score | grade |
| 2 | Alice | 16 | female | 95 | A |
| 3 | Bob | 18 | male | 83 | B |
| 4 | ... |


## Author

👤 **render**

* Github: [@zjcrender](https://github.com/zjcrender)

---
_Source: https://npm.io/package/@zjcdaniel/json-to-xlsx · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
