Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/memona008/jsontocsv
An NPM package which receives JSON and convert it into CSV file.
https://github.com/memona008/jsontocsv
Last synced: 23 days ago
JSON representation
An NPM package which receives JSON and convert it into CSV file.
- Host: GitHub
- URL: https://github.com/memona008/jsontocsv
- Owner: memona008
- Created: 2019-09-25T10:05:52.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-09-26T07:12:06.000Z (over 5 years ago)
- Last Synced: 2024-11-24T09:35:34.833Z (about 1 month ago)
- Language: JavaScript
- Homepage:
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Easy-JSON-To-CSV-Converter
Exports a structured JSON array/object to CSV file## Installation
```bash
npm i easy-json-to-csv-converter
```## Usage
```node
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 );```