javascript fetch an image and create base64

I’m using CloudFlare service workers and I want to fetch an image and then generate a base64 representation of it.

So something like this:

const res = await fetch('')
  const blob = await res.blob();

this of course doesn’t work, any ideas how to get this resolved?

Source: JavaSript – Stack Overflow

October 13, 2021
Category : News
Tags: base64 | cloudflare | javascript | service-worker

Leave a Reply

Your email address will not be published. Required fields are marked *

Sitemap | Terms | Privacy | Cookies | Advertising

Senior Software Developer

Creator of @LzoMedia I am a backend software developer based in London who likes beautiful code and has an adherence to standards & love's open-source.