I\'m trying to read the content of test.txt(which is on the same folder of the Javascript source) and display it using this code:
test.txt
var fs = requi
From the docs:
If no encoding is specified, then the raw buffer is returned.
Which might explain the . Specify a valid encoding, for example utf-8, as your second parameter after the filename. Such as,
utf-8
fs.readFile("test.txt", "utf8", function(err, data) {...});