I have a file temp.js that contains text as below:
module.config = {
key1 : 'value1',
key2 : 'value2',
key3 : ['abc','def']
}
I am reading the file as below:
fs.readFile('/temp.js', function(err,fileContents) {
console.log(fileContents);
});
on the output I am getting values as below:
<Buffer 6d 6f .....
...>
What am i missing here ?
6d 6fare the lettersmando. I'm guessing you want to evaluate the file as Javascript, which... really isn't what you're doing, here.