I'm a beginners with Node.JS... I created a .Json file from a .csv with the 'csvtojson module' but I can't find out how save the Json in a global variable in order to use it... Could someone help me?
const CSVToJSON = require('csvtojson');
const fs = require('fs');
// convert users.csv file to JSON array
CSVToJSON().fromFile('flyers_data.csv')
.then( flyers_data => {
console.log(flyers_data);
}).catch(err => {
// log error if any
console.log(err);
});