Node.js Buffer toJSON() convert buffer content to String
toJSON()
var buf = new Buffer.from('Simply Easy Learning'); var json = buf.toJSON(buf); console.log(json);//w ww . j a v a 2s . co m