A function to easily generate csv downloads of your json data. ✨
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>
The first argument is data. This is all that is required.
<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 |
3 | delimiter | string | optional | "," | field separator |
Please help provide good data faster! Submit any issues and/or make a pull request!