A library that handles csv files and its metadata for js or typescript projects.
npm install csv-grape
import { CsvGrape } from 'csv-grape';
CsvGrape.getCsvData(event,limit).then((_response)=>{
this.data=_response;
},(reject)=>{
console.log(reject);
});
limit
is an optional parameter . When the file size is very big and you don't want to load full file . Use limit parameter to get limited rows from the csv file.
//Here we can get _response from getCsvData(event,limit)
this.csvMetaData= JSON.stringify(CsvGrape.getMetaData(_response.Data,_response.Headers));
limit
is an optional parameter . When the file size is very big and you don't want to load full file . Use limit parameter to get limited rows from the csv file.
CsvGrape.getCsvWithMetaData(event,limit).then((_response)=>{
this.csvJsonAndMetaData=_response;
},(reject)=>{
console.log(reject);
});
limit
is an optional parameter . When the file size is very big and you don't want to load full file . Use limit parameter to get limited rows from the csv file.