Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/praveenkumar-kalidass/react-json-csv
A React library to render a component that helps in json to csv conversion.
https://github.com/praveenkumar-kalidass/react-json-csv
convert csv json react
Last synced: about 1 month ago
JSON representation
A React library to render a component that helps in json to csv conversion.
- Host: GitHub
- URL: https://github.com/praveenkumar-kalidass/react-json-csv
- Owner: praveenkumar-kalidass
- License: mit
- Created: 2018-10-05T12:01:13.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2021-05-18T13:47:25.000Z (over 3 years ago)
- Last Synced: 2024-12-01T23:36:48.397Z (about 1 month ago)
- Topics: convert, csv, json, react
- Language: JavaScript
- Homepage: https://github.com/praveenkumar-kalidass/react-json-csv#readme
- Size: 945 KB
- Stars: 16
- Watchers: 2
- Forks: 8
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# React Json Csv
A React library to render a component that helps in json to csv conversion.## Install
Install the component using [NPM](https://www.npmjs.com/):
```sh
$ npm install --save react-json-csv
```## Usage
### Initialise module
```js
import {
JsonToCsv,
useJsonToCsv
} from 'react-json-csv';
```### Render
- [Json To Csv](#json-to-csv)
- [use Json To Csv](#use-json-to-csv)#### Json To Csv
Converts json to csv file (.csv format) and downloads it```js
const filename = 'Csv-file',
fields = {
"index": "Index",
"guid": "GUID"
},
style = {
padding: "5px"
},
data = [
{ index: 0, guid: 'asdf231234'},
{ index: 1, guid: 'wetr2343af'}
],
text = "Convert Json to Csv";
``````html
```
#### use Json To Csv
```js
const { saveAsCsv } = useJsonToCsv();
``````html
useJsonToCsv
```html
## License
[MIT License](http://opensource.org/licenses/MIT)