Closed phaux closed 12 months ago
You can easily convert Base64 to a Buffer. I don't think this is common of enough need to support built-in.
Buffer.from(b64string, 'base64');
But Buffer.from
is node only :/
Yeah I know, but the fetch data url method is async and better on front-end where you want consistent 60fps. Just sayin.
What alternatives do we have according to that SO post:
atob
which is for parsing base64 encoded strings, not any bytes.Buffer.from
- node only.
We need to know the mime type before we can parse it using fetch data url.