1.0.0 • Published 7 years ago

csverter v1.0.0

Weekly downloads
3
License
ISC
Repository
github
Last release
7 years ago

CSVerter

A simple JSON to CSV converter.

Installation

Using npm:

npm i csverter

then in your js file:

const csverter = require('csverter');

or directly in your html:

<script src="dist/csverter.min.js"></script>

Usage

var jsonData = [
    { x: 1, y: 2, z: 3 },
    { z: 4 }
];

var csv = csverter.convertJsonToCsv(jsonData);

console.log(csv);

var tabDelimitedCsv = csverter.convertJsonToCsv(jsonData, {
    // with a custom field separator - defaults to ','
    fieldSeparator: '\t',
    // with a custom line separator - defaults to '\n'
    lineSeparator: '\r\n'
});

console.log(tabDelimitedCsv);
1.0.0

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago