Skip to content

Instantly share code, notes, and snippets.

@tonytopper
Last active August 29, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tonytopper/9811434 to your computer and use it in GitHub Desktop.
Save tonytopper/9811434 to your computer and use it in GitHub Desktop.
var fs = require('fs');
var fileName = __dirname + '/data.json';
try {
fs.readFile(fileName, 'utf8', function(err, data) {
if (err) throw err;
data = JSON.parse(data);
});
} catch(err) {
console.error(err);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment