Socket
Socket
Sign inDemoInstall

react-json-csv

Package Overview
Dependencies
7
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    react-json-csv

A React component to handle json to csv conversion


Version published
Weekly downloads
3.7K
decreased by-0.11%
Maintainers
1
Install size
510 kB
Created
Weekly downloads
 

Readme

Source

React Json Csv

A React library to render a component that helps in json to csv conversion.

npm version dependencies Status badge devDependency Status badge Downloads Paypal

Install

Install the component using NPM:

$ npm install --save react-json-csv

Usage

Initialise module

import {
  JsonToCsv,
  useJsonToCsv
} from 'react-json-csv';

Render

Json To Csv

Converts json to csv file (.csv format) and downloads it

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";
<JsonToCsv
  data={data}
  filename={filename}
  fields={fields}
  style={style}
  text={text}
/>
use Json To Csv
const { saveAsCsv } = useJsonToCsv();
<button onClick={saveAsCsv({ data, fields, filename })}>
  useJsonToCsv
</button>
```html

## License

[MIT License](http://opensource.org/licenses/MIT)

Keywords

FAQs

Last updated on 08 Sep 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc