1.0.6 • Published 5 years ago

easy-json-to-csv-converter v1.0.6

Weekly downloads
4
License
ISC
Repository
github
Last release
5 years ago

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 );
1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago

1.0.0

5 years ago