Example of Encoding option on fs.readFile()
var str = fs.readFile('foo.txt', 'utf8', function(err, data){
if (err) throw err;
.........
});
Will convert the Buffer into a String.
Written by Melanie Archer
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Nodejs
Authors
Related Tags
#nodejs
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#