Base64 Encoder/Decoder Stream
bash
npm install @victorenator/base64
`Examples
$3
`js
const res = await fetch('/base64data');
res.body
.pipeThrough(createBase64DecoderStream())
.pipeTo(...)
`$3
`js
const stream = new ReadableStream({
start(controller) {
controller.enqueue('ABC 123');
controller.stop();
}
})
.pipeThrough(new TextEncoderStream())
.pipeThrough(createBase64EncoderStream());
await fetch('/base64data', {
method: 'PUT',
body: stream,
});
``