# tiny-xlsx

> Simple XLSX generator

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

## Install

```sh
npm install tiny-xlsx
pnpm add tiny-xlsx
yarn add tiny-xlsx
bun add tiny-xlsx
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.9 |
| Published | 2019-03-03 |
| First published | 2019-02-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 136.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | FlamingTempura |
| Maintainers | flamingtempura |

## Links

- npm: https://www.npmjs.com/package/tiny-xlsx
- npm.io page: https://npm.io/package/tiny-xlsx

## Dependencies (1)

- [jszip](https://npm.io/package/jszip.md) ^3.2.0

## Recent versions

- 1.0.9 (latest) — 2019-03-03
- 1.0.8 — 2019-03-03
- 1.0.7 — 2019-03-03
- 1.0.6 — 2019-03-03
- 1.0.5 — 2019-02-26
- 1.0.4 — 2019-02-26
- 1.0.3 — 2019-02-26
- 1.0.2 — 2019-02-26
- 1.0.1 — 2019-02-26
- 1.0.0 — 2019-02-26

## README

## TinyXLSX

XLSX spreadsheet writer for Node.js and browsers.

### Node.js

`npm install tiny-xlsx`

```js
import TinyXLSX from 'tiny-xlsx';

let summary = [
	['Annual Sales',  40000 ],
	['Costs',         30000 ],
	['Profit',        10000 ]
];

let transactions = [
	['Date',       'Description',       'Amount'],
	['2017-01-01', 'Sales',               200   ],
	['2017-01-01', 'Sales',               -20   ],
	['2017-01-01', 'Sales',              1200   ],
	['2017-01-01', 'Sales',               -10.5 ]
];

let sheets = [
	{ title: 'Summary', data: summary },
	{ title: 'Transactions', data: transactions }
];

TinyXLSX.generate(sheets)
	.write('accounts.xlsx')
	.then(() => console.log('done!'));
```

### Browser


```html
<script script="https://unpkg.com/tiny-xlsx"></script>

<script>

let data = [
	[1, 2]
	['hello', 'world']
];

let sheets = [{ title: 'Hello World', data }];

TinyXLSX.generate(sheets)
	.base64()
	.then(base64 => {
		location.href = "data:application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;base64," + base64;
	});

</script>
```

### API

#### TinyXLSX.generate(sheets) ==> workbook

Generates XLSX file for given array of sheets.

#### workbook.write(filename) ==> Promise [Node only]

Writes workbook to given filename.

#### workbook.stream() ==> stream [Node only]

Provides a stream.

#### workbook.base64() ==> Promise

Provides a base64 string.

#### workbook.blob() ==> Promise

Provides a blob.

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