Export Data as CSV or Convert CSV Data | CSVx.js

CSVx.js is a library that provides an easy way to export your data as a CSV file or convert your CSV data to something else. This JavaScript generates a downloadable CSV file from the JavaScript array and fills the HTML table with the CSV data.

Bootstrap Data Table With Checkbox, Sort, Pagination, Export, DetailView, and More

How to make use of it:

Install & Download.

# NPM
$ npm install @lcluber/csvxjs --save

Import the Export and Convert modules.

import { Export, Convert } from '@lcluber/csvxjs';

Conver an array of objects right into a CSV file. Possible parameters:

var array = [
    {
      firstname:'Jill',
      lastname:'Smith',
      age:50
    },
    {
      firstname:'Eve',
      lastname:'Jacksona',
      age:94
    },
    {
      firstname:'Mary',
      lastname:'Moe',
      age:43
    }
];
Export.data('example',array,{
  separator: ';'
});

Convert CSV data into an HTML table. Possible parameters:

var data = '"Firstname";"Lastname";"Age"\r\n\
"Jill";"Smith";"50"\r\n\
"Eve";"Jacksona";"94"\r\n\
"Mary";"Moe";"43"';
document.getElementById("table").innerHTML = Convert.table(data,{separator: ';'}, {table: 'table'});

Possible options for the Export.

Export.data('example',array,{
  data: 'text/csv',
  charset: 'utf-8',
  labels: true,
  quote: '"',
  separator: ',',
  CRLF: '\r\n',
  customLabels: []
});

Possible choices for the Convert.

Convert.table(data,{
  labels: true,
  quote: '"',
  separator: ',',
  CRLF: '\r\n'
},{
  table: '',
  th: ''
});

JS Array To CSV Exporter And CSV To Table Converter, CSVx JS Plugin/Github


See Demo And Download

Official Website(LCluber): Click Here

This superior jQuery/javascript plugin is developed by LCluber. For extra Advanced Usages, please go to the official website.

Related Posts

Vector-Graphs-smartGraph

Generating Beautiful Vector Graphs With jQuery | smartGraph

SmartGraph is a free and easy-to-use JavaScript library to create beautiful vector diagrams with many customizations. This plugin allows developers to create dynamic, responsive, draggable vector graphics…

vue-image-slider-transition

Image Slider With 20 Cool Transitions Component | vue-flux

Vue flux is an image slider developed with Vuejs 2 that comes with 20+ nice transitions out of the box. Included transitions 2D transitions Fade: Fades from…

simple-parallax-scrolling

Simple background Image Parallax Scroll Plugin In jQuery

Background parallax effect is a simple jQuery background image without any library. Uses jQuery’s scroll() function to track the scroll event and applies the exact parallax scroll…

bootstrap-color-picker-plugin

Modular Color Picker Plugin for Bootstrap | BS Colorpicker

Bootstrap Colorpicker is a standard color picker plugin for Bootstrap 4. Colorpicker Plugin for Bootstrap 5/4/3 frameworks that allow you to add a color picker to an…

gdpr-iframe-manager-js

GDPR Friendly iFrame Manager In Vanilla JS | iframemanager

IframeMananger is a lightweight JavaScript plug-in that helps you to comply with GDPR by completely removing iframes at first and setting a notice related to that service….

diagonal-slider-anime-js

Diagonal Thumbnails Carousel Slider | Anime.js

Diagonal Slider is a cool mini carousel made with Anime.js JavaScript library. It takes a bunch of pictures and turns them into a circular user interface where…