const imageToBase64 = require ( "image-to-base64" ) ; export async function urlBase ( url ) { let encoded = "" ; await imageToBase64 ( url ) . then ( ( response ) => { return ( encoded = response ) ; } ) . catch ( ( error ) => { console . log ( error ) ; } ) ; return encoded ; }