index.js
function encode (body) {
  var str = JSON.stringify(body)
  return Buffer.from(str).toString('base64')
}
function encode (body) {
  var str = JSON.stringify(body)
  return Buffer.from(str).toString('base64')
}
function encode ( body ) { var str = JSON . stringify ( body ) return Buffer . from ( str ) . toString ( 'base64' ) }
Encode an object into a base64-encoded JSON string.

@param {Object} body
@return {String}
@private
Encode an object into a base64 - encoded JSON string .