Socket
Socket
Sign inDemoInstall

json-csv-transformer

Package Overview
Dependencies
5
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    json-csv-transformer

transform json to csv, and vice versa


Version published
Weekly downloads
8
decreased by-27.27%
Maintainers
1
Install size
1.96 MB
Created
Weekly downloads
 

Readme

Source

json-csv-transformer

transform json to csv, and vice versa

node npm license Build Status Standard - JavaScript Style Guide Coveralls Status

Install

npm install json-csv-transformer --save

Use

import CSV from 'json-csv-transformer'

const csv = new CSV({
  schema: [{
    key: 'xxx',
    label: 'XXX',
    type: 'string',
  }]
})

// parse data, csv or json
csv.parse(data)
// get file dataURL
csv.getDataURL()
// transform to JSON
csv.toJSON()

find more use case, please see test

Schema

fieldtyperequireddescription
keystringtruekey for this schema
labelstringfalseit will display in the header
typestring | boolean | date | numberfalsedefault type is string, it will be ignored if formatter is present
formatter{csv: function, json: function}falsecustom formatter, csv for transform to csv, json for transform to json

Keywords

FAQs

Last updated on 27 Aug 2019

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