Last Updated: February 25, 2016
·
1.986K
· mejarc

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.