Created
June 17, 2021 13:29
-
-
Save Wyru/f0e1ec5685da2fdcaafacecde7edc370 to your computer and use it in GitHub Desktop.
Example of how convert a image to base64 with js
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
const Axios = require('axios').default; | |
const handle = async() => { | |
const response = await Axios.get("https://game-icons.net/icons/ffffff/000000/1x1/lorc/robe.svg"); | |
const base64 = Buffer.from(response.data).toString('base64'); | |
console.log(base64); | |
} | |
handle(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment