I am playing around with some nodeJs things, I read about block and functions scooping but I was not able to access my variable jsonArrayObj:
csv({delimiter: [' ']})
.fromFile(csvFilePath)
.on('end_parsed', function(jsonArrayObj) {
console.log(jsonArrayObj);
function cssResult() {
return jsonArrayObj;
}
})
.on('error', (err) => {
console.log(err);
});
console.log('jsonArrayObj'); // I want to print the results here also