Personal intranet/start page where I can view the weather, links, fitbit data, and the news.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

35 lines
752 B

const fs = require('fs');
module.exports=
{
/**
*
* @param fileName
* @returns {any}
*/
getFileAsJSON: function(fileName)
{
return JSON.parse(module.exports.getFile(fileName));
},
getFile: function(filename)
{
return fs.readFileSync(filename, 'utf8');
},
saveFile: function(filename, contents)
{
fs.writeFile(filename, contents, function(err)
{
if(err)
{
console.log(err);
}
else
{
console.log(filename + " saved");
}
});
}
};