let obj;
fs.readFile("config.json", (err, data) => {
if (err){
console.log(err);
} else {
obj = JSON.Parse(data);
}
});
console.log(obj);
async function foo() {
try {
const content = await fs.readFile("config.json", "utf-8");
const obj = JSON.parse(content);
console.log(obj);
} catch(error) {
console.error(error);
};
}