Created
August 20, 2017 07:36
-
-
Save rxon/549b506f3c141b87e0cea1d088821237 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getBase64() { | |
return new Promise(function(resolve, reject) { | |
axios | |
.get(url, { | |
responseType: 'arraybuffer' | |
}) | |
.then(response => | |
resolve(new Buffer(response.data, 'binary').toString('base64')) | |
); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment