Socket
Socket
Sign inDemoInstall

easy-json-to-csv-converter

Package Overview
Dependencies
5
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    easy-json-to-csv-converter

Exports a structured JSON array/object to CSV file


Version published
Weekly downloads
164
increased by21.48%
Maintainers
1
Install size
2.70 MB
Created
Weekly downloads
 

Readme

Source

Easy-JSON-To-CSV-Converter

Exports a structured JSON array/object to CSV file

Installation

npm i easy-json-to-csv-converter

Usage

import {ConvertJSONtoCSV} from "easy-json-to-csv-converter";

    let jsonArray = [{ name: "memona", lastName: "sultan" }];
    let fileName = "myNameFile";

    // 1 for as it is name; 2 for name with dateTime appended
    let fileNameMode = 1; 

    // true = file will have a header , false = file will not have a header
    let showLabels = true;


    // if you want to change the column names you have to map them 
    let mappedColumns = [
      { key: "name", value: "First Name" },
      { key: "lastName", value: "Last Name" }
    ];


    // this method will download a csv file
   ConvertJSONtoCSV(jsonArray, fileName, fileNameMode, showLabels,mappedColumns );

Keywords

FAQs

Last updated on 26 Sep 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