csv-wp
A simple CSV writer and parser
Installation
$ npm install csv-wp
Usage:
const csvwp = //Optional. These are default valuesconst options = encoding: 'UTF-8' delimiter: ',' //',' or ';' //Print entire .csv filecsvwp //Returns an Array with all lineslet lines = csvwp; //Returns an Array with the 5th linelet line = csvwp; //Returns .csv header (line 0)let header = csvwp; //Returns an Array with a given collumnlet atr = csvwp; //Find rows by searching a (key,value) pairlet found = csvwp; //Append a row to a .csv fileconst data = '03/24/2020 08:26''Testing''example@example.com''+553298''Verified';csvwp; //Write a row to a .csv file (Current data will be overwritten)const data = '03/24/2020 08:26''Testing''example@example.com''+553298''Verified';csvwp; //Write an entire .csv file with header and bodyconst header = 'Date''Name''Email''Contact''Status';let data = '24/03/2020 08:26''Name 1''test@test.com''+553298''Verified' '18/10/2019 11:43''Name 2''mail@mail.com''+553298''Pending';csvwp;