media-helper.js
function urlToBase64 (url) {
  return new Promise((resolve, reject) => {
    request.get(url, (err, response, body) => {
      err && reject(err)
      resolve(body.toString('base64'))
    })
  })
}
function urlToBase64 (url) {
  return new Promise((resolve, reject) => {
    request.get(url, (err, response, body) => {
      err && reject(err)
      resolve(body.toString('base64'))
    })
  })
}
function urlToBase64 ( url ) { return new Promise ( ( resolve , reject ) => { request . get ( url , ( err , response , body ) => { err && reject ( err ) resolve ( body . toString ( 'base64' ) ) } ) } ) }
Reads an image from url and convert it to base64
@param {string} url
@returns {Promise}
Reads an image from url and convert it to base64