⌗ json-to-csv-export

A function to easily generate csv downloads of your json data. ✨

npm package version npm downloads code style: prettier

Features

  • Create a csv download from json data
  • Lightweight
  • Easy to use
  • optional filename

Install

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>

Example Usage

The first argument is data. This is all that is required.

  <button onClick={() => csvDownload(mockData)}>
    Download Data
  </button>

Arguments

#ArgumentTypeRequirementDefaultDescription
1dataobjectrequirednullobject or array of objects
2filenamestringoptional"export.csv"The complete filename

Contributing

Please help provide good data faster! Submit any issues and/or make a pull request!