1.1.0 • Published 10 months ago

@victorenator/base64 v1.1.0

Weekly downloads
-
License
Apache-2.0
Repository
gitlab
Last release
10 months ago

Base64 Encoder/Decoder Stream

Install

npm install @victorenator/base64

Examples

Decode Base64-data from network

const res = await fetch('/base64data');
res.body
    .pipeThrough(createBase64DecoderStream())
    .pipeTo(...)

Encode Base64-data to network

const stream = new ReadableStream({
    start(controller) {
        controller.enqueue('ABC 123');
        controller.stop();
    }
})
    .pipeThrough(new TextEncoderStream())
    .pipeThrough(createBase64EncoderStream());
await fetch('/base64data', {
    method: 'PUT',
    body: stream,
});
1.1.0

10 months ago

1.0.0

10 months ago