Skip to content

Latest commit

 

History

History
66 lines (37 loc) · 1.66 KB

csv-grape.md

File metadata and controls

66 lines (37 loc) · 1.66 KB

csv-grape

Csv-Grape npm MIT License Build Pass

A library that handles csv files and its metadata for js or typescript projects.

Installation

npm install csv-grape

Initiate the service

import { CsvGrape } from 'csv-grape';

Get all csv content

  
    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.

Get csv file metadata

//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.

Get csv content with metadata

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.