I would like to parse a csv file from an http call and go thru each record.. For now I am using the below code to grab the whole content of .csv file, but I don't see any way that I can go thru each of the records on the .csv file.
var body = [];
request
.get('https://api.pluralsight.com/api-v0.9/users?planId=x&token=x')
.on('data', function (chunk) {
body.push(chunk);
})
.on('end', function () {
body = body.join('');
// body now contains csv contents as a string
res.json(body);
});
Is there any way that I can convert this into an array of objects or something similiar that I can grab each record seperately?
Thanks