Created
January 25, 2018 14:45
-
-
Save JamWils/9c08a8c2afbcc7db46cea31d5ee77c3f to your computer and use it in GitHub Desktop.
Stack Overflow Help
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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