Closed NicholasZonenberg closed 5 years ago
I uploaded a better Example to the repo.
Assuming you have jquery-csv installed via npm (ie npm i jquery-csv
) the following will work.
var fs = require('fs');
var csv = require('jquery-csv');
var sample = './data/sample.csv';
fs.readFile(sample, 'UTF-8', function (err, csv) {
if (err) { console.log(err); }
csv.toArrays(csv, {}, function (err, data) {
if (err) { console.log(err); }
for (var i = 0, len = data.length; i < len; i++) {
console.log(data[i]);
}
});
});
Subject of the issue
TypeError: csv.replace is not a function
Environment
Steps to reproduce
install via NPM and use via: var jqueryCsv = require("jquery-csv")
Expected behaviour
Should work without error
Actual behaviour
The program does not compile as there is a non function function