Files
freeCodeCamp/utils/openJSONFile.js
2018-11-22 02:13:48 +05:30

10 lines
212 B
JavaScript

const fs = require('fs');
const openJSONFile = fileName => {
const data = JSON.parse(fs.readFileSync(fileName, 'utf8'));
console.log('Opened JSON file')
return data;
};
module.exports = { openJSONFile };