# @ailnaf/xlsx2csv

> convert xlsx to csv

Latest version **1.3.8** (published 2022-12-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install @ailnaf/xlsx2csv
pnpm add @ailnaf/xlsx2csv
yarn add @ailnaf/xlsx2csv
bun add @ailnaf/xlsx2csv
```

## Health

**Score 35/100 (D)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.3.8 |
| Published | 2022-12-16 |
| First published | 2022-07-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 4 |
| Unpacked size | 177.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Maintainers | ailnaf |
| Keywords | xlsx, csv |

## Links

- npm: https://www.npmjs.com/package/@ailnaf/xlsx2csv
- Repository: https://github.com/fanlia/xlsx2csv
- Homepage: https://github.com/fanlia/xlsx2csv#readme
- Issues: https://github.com/fanlia/xlsx2csv/issues
- npm.io page: https://npm.io/package/@ailnaf/xlsx2csv

## Dependencies (4)

- [ssf](https://npm.io/package/ssf.md) ^0.11.2
- [jszip](https://npm.io/package/jszip.md) ^3.10.1
- [saxes](https://npm.io/package/saxes.md) ^6.0.0
- [node-stream-zip](https://npm.io/package/node-stream-zip.md) ^1.15.0

## Alternatives

- [@sapphire/ratelimits](https://npm.io/package/@sapphire/ratelimits.md) — 4.4K weekly downloads
- [js-csvparser](https://npm.io/package/js-csvparser.md) — 2.0K weekly downloads
- [@adadapted/js-sdk](https://npm.io/package/@adadapted/js-sdk.md) — 251 weekly downloads
- [@grapecity/spread-sheets-sparklines](https://npm.io/package/@grapecity/spread-sheets-sparklines.md) — 103 weekly downloads
- [@1selfworld/adchain-sdk-react-native](https://npm.io/package/@1selfworld/adchain-sdk-react-native.md) — 80 weekly downloads

## Recent versions

- 1.3.8 (latest) — 2022-12-16
- 1.3.7 — 2022-12-16
- 1.3.6 — 2022-10-22
- 1.3.5 — 2022-10-21
- 1.3.4 — 2022-10-10
- 1.3.3 — 2022-08-07
- 1.3.2 — 2022-08-07
- 1.3.1 — 2022-08-07
- 1.3.0 — 2022-08-06
- 1.2.3 — 2022-07-22
- 1.2.2 — 2022-07-21
- 1.2.1 — 2022-07-21
- 1.2.0 — 2022-07-21
- 1.1.10 — 2022-07-20
- 1.1.9 — 2022-07-19
- … 10 more at https://npm.io/package/@ailnaf/xlsx2csv/versions

## README

# xlsx2csv

xlsx2csv for browser and nodejs with performance considered

[demo](https://fanlia.github.io/xlsx2csv/)

## Install

```sh
npm i @ailnaf/xlsx2csv
```

## Usage

### esm

```javascript
import xlsx2csv from '@ailnaf/xlsx2csv'

```

### cdn

```html
<script src="https://unpkg.com/@ailnaf/xlsx2csv/xlsx2csv.min.js"></script>
```

### cjs

```javascript
const { default: xlsx2csv } = await import('@ailnaf/xlsx2csv')
```

### nodejs

```javascript

const filename = 'data.xlsx'

xlsx2csv(filename, console.log)

```

### browser

```javascript
const buffer = await fetch('data.xlsx').then(res => res.blob())

xlsx2csv(buffer, console.log, { sheet: { max: 100 } })

// [ 'hello', 'world' ]
// [ 'bar', 'foo' ]


const rows = await xlsx2csv(buffer, null, { sheet: { max: 100, collect: true } })
console.log(rows)

// [ [ 'hello', 'world' ], [ 'bar', 'foo' ] ]

const rows = await xlsx2csv(buffer, null, { sheet: { max: 100, collect: true, json: true } })
console.log(rows)

// [ { hello: 'bar', world: 'foo' } ]
```

### export xlsx

for small files browser and nodejs

```javascript
import csv2xlsx from '@ailnaf/xlsx2csv/csv2xlsx'

const source = [
    ['number1', 'number2', 'hello', 'number3', null, 'date', 'list'],
    [12.7, 12.8, 'world', '100', null, new Date(), [1,2,3]],
]

csv2xlsx(source)
.then(buf => {
    console.log(buf)
})
.catch(console.log)

```

## Test

```sh
# all data
node test.js data.xlsx

# 1 row
node test.js data.xlsx 1
```

## License

MIT

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