// read the file and print the content const fs = require('fs'); const path = require('path'); const data = fs.readFileSync(path.join(__dirname, 'data.json'), 'utf8'); console.log(data); // Fix the file and print the content try { const wrong = fs.readFileSync(path.join(__dirname, 'wrong.json'), 'utf8'); console.log(wrong); } catch (err) { console.error('Error reading file. Does it exist?'); }