A function to easily generate csv downloads of your json data. ✨
https://json-to-csv-export.coston.io
- Create a csv download from json data
- Lightweight
- Easy to use
- optional filename
Install with npm:
npm i json-to-csv-export
Or load from a CDN:
<script src="https://cdn.jsdelivr.net/npm/json-to-csv-export"></script>
import csvDownload from 'json-to-csv-export'
...
<button onClick={() => csvDownload(mockData)}>
Download Data
</button>
# | Argument | Type | Requirement | Default | Description |
---|---|---|---|---|---|
1 | data | object |
required |
null |
object or array of objects |
2 | filename | string |
optional |
"export.csv" | The complete filename |
Please help provide good data faster! Submit any issues and/or make a pull request!