Files
freeCodeCamp/utils/open-json-file.js
2018-12-03 00:09:23 +05:30

9 lines
178 B
JavaScript

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