Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-json-csv

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-json-csv

A React component to handle json to csv conversion

  • 2.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2.6K
decreased by-3.43%
Maintainers
1
Weekly downloads
 
Created
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

Package last updated on 08 Sep 2020

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc