Website for visualizing a persons github network.
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.
 
 
 

32 lines
717 B

/** Used to read and write files from disk */
const fs = require('fs');
module.exports =
{
writeJSONToFile: function(fileName, jsonObject)
{
const json = JSON.stringify(jsonObject, null, 4);
fs.writeFile(fileName, json, 'utf8', function()
{
console.log("Wrote to " + fileName);
});
},
/**
*
* @param fileName
* @returns {any}
*/
getFileAsJSON: function(fileName)
{
return JSON.parse(module.exports.getFile(fileName));
},
getFile: function(filename)
{
return fs.readFileSync(filename, 'utf8');
}
};