A polyfill for Uint8Array.fromBase64 and Uint8Array.prototype.toBase64.
In modern browsers and Node.js >= 25, this module is a no-op. Otherwise, it patches both the constructor and the prototype once.
This implementation relies on atob and btoa. On Node.js < 16, polyfill those globals before importing this module.
import 'https://esm.run/@ungap/base64';
const asBase64 = new TextEncoder().encode('hello base64!').toBase64();
// aGVsbG8gYmFzZTY0IQ==
const fromBase64 = new TextDecoder().decode(Uint8Array.fromBase64(asBase64));
// 'hello base64!'