Skip to content

Instantly share code, notes, and snippets.

@JamWils
Created January 25, 2018 14:45
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 JamWils/9c08a8c2afbcc7db46cea31d5ee77c3f to your computer and use it in GitHub Desktop.
Save JamWils/9c08a8c2afbcc7db46cea31d5ee77c3f to your computer and use it in GitHub Desktop.
Stack Overflow Help
// For help with question at https://stackoverflow.com/questions/48427217/nodejs-reading-file-does-not-work
const fs = require('fs');
const path = require('path');
console.log('beforereadfile');
fs.readFile(path.join('.', '/test.json'), 'utf8', function (err, data) {
if (err) {
console.log('Error loading client secret file: ' + err);
return;
}
console.log('insidereadfile - data');
console.log(JSON.parse(data));
});
process.stdin.resume();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment