# @shujo/excel-export

> A simple node module for exporting data set to excel.

Latest version **1.1.1** (published 2020-08-04) · ISC license · 0 weekly downloads

## Install

```sh
npm install @shujo/excel-export
pnpm add @shujo/excel-export
yarn add @shujo/excel-export
bun add @shujo/excel-export
```

## 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.1.1 |
| Published | 2020-08-04 |
| First published | 2020-08-04 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 3.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | shujo |
| Maintainers | shujo |
| Keywords | excel, export |

## Links

- npm: https://www.npmjs.com/package/@shujo/excel-export
- Repository: https://github.com/shujo/export-excel
- Homepage: https://github.com/shujo/export-excel#readme
- Issues: https://github.com/shujo/export-excel/issues
- npm.io page: https://npm.io/package/@shujo/excel-export

## Dependencies (3)

- [exceljs](https://npm.io/package/exceljs.md) ^4.1.1
- [node-blob](https://npm.io/package/node-blob.md) 0.0.2
- [file-saver](https://npm.io/package/file-saver.md) ^2.0.2

## Recent versions

- 1.1.1 (latest) — 2020-08-04
- 1.1.0 — 2020-08-04
- 1.0.3 — 2020-08-04
- 1.0.2 — 2020-08-04
- 1.0.1 — 2020-08-04
- 1.0.0 — 2020-08-04

## README

# export-excel
A simple node module for exporting data set to excel file or excel buffer.

## Install
```json
npm i @shujo/export-excel --save 
```

## Usage
```javascript
const { generateExcelFile, generateExcelBuffer } = require('@shujo/export-excel')
//or
import { generateExcelFile, generateExcelBuffer } from '@shujo/export-excel'
```

## Generate Excel File
```javascript
import { generateExcelFile } from '@shujo/export-excel'

(async() => {
    try{
        const options = {
            filename: "sample-filename"
            sheet: "Sheet1",
            columns: [
                { header: "ID" , key: "id", width: 10 },
                { header: "Name" , key: "id", width: 10 }
            ],
            rows: [
                { id: 1, name: "Foo" },
                { id: 2, name: "Bar" },
            ]
        }
        await generateExcelFile(options);
    }catch(error){
        console.log(error);
    }
})
```

## Generate Excel Buffer
```javascript
import { generateExcelBuffer } from '@shujo/export-excel'

(async() => {
    try{
        const options = {
            sheet: "Sheet1",
            columns: [
                { key: "id", header: "ID", width: 10 },
                { key: "name", header: "Name", width: 10 }
            ],
            rows: [
                { id: 1, name: "Foo" },
                { id: 2, name: "Bar" },
            ]
        }
        let bufferData = await generateExcelBuffer(options);
        console.log(bufferData);
    }catch(error){
        console.log(error);
    }
})
```

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