Alternative solution without using setEncoding

without using setEncoding, data is a Buffer object, hence it needs to be converted to a string prior to console.log