base64 JSON encoded strings in nodejs
To complete @ladenedge's comment for clarity reasons:
var buff = Buffer.from(JSON.stringify({"hello":"world"})).toString("base64")
var buff = new Buffer(JSON.stringify({"hello":"world"})).toString("base64");