Download an image using Axios and convert it to base64 : <p>I need to download a .jpg image from a remote server and convert it into a base64 format. I'm using axios as my HTTP client. I've tried issuing a git request to the server and checking the <code>response.data</code> however it doesn't seem to work like that. </p>

<p>Link to axios: <a href="https://github.com/mzabriskie/axios" rel="noreferrer">https://github.com/mzabriskie/axios</a></p>

<p>Link to base64 implementation: <a href="https://www.npmjs.com/package/base-64" rel="noreferrer">https://www.npmjs.com/package/base-64</a></p>

<p>I'm using NodeJS / React so atob/btoa doesn't work, hense the library. </p>

<pre><code>axios.get('http://placehold.it/32').then(response =&gt; {
    console.log(response.data); // Blank
    console.log(response.data == null); // False 
    console.log(base64.encode(response.data); // Blank
}).catch(err =&gt; console.log(err));
</code></pre>
