Skip to content

Instantly share code, notes, and snippets.

@JamWils
Created Jan 25, 2018
Embed
What would you like to do?
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