1.0.0 • Published 1 year ago

@hashir-sp/csv-reader v1.0.0

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

csv-reader

Reading a csv file

const readCSV = require("@hashir-sp/csv-reader");

/* 
The function takes 4 arguments:
- filePath: The path to the csv file
- line: The line on which it will start reading the data
- onData: Callback function when a line of data is read. The callback takes one argument 'data' which is an array of values
- onEnd: Callback function when all data has been read
*/

readCSV("./jobs.csv", 2, (data) => {
    console.log(data);
}, () => {
    console.log("Finish reading file!");
})
1.0.0

1 year ago