Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uhm, why did you create this? #2

Open
jimmywarting opened this issue May 12, 2023 · 1 comment
Open

Uhm, why did you create this? #2

jimmywarting opened this issue May 12, 2023 · 1 comment

Comments

@jimmywarting
Copy link

jimmywarting commented May 12, 2023

btoa exist everywhere now basically. it's global in nodejs since v16.

https://nodejs.org/dist/latest/docs/api/globals.html#btoadata

v16 is LTS right now...

And there is also kind of already one out there that dose the same thing: https://github.com/hughsk/btoa-lite

also using base64 should best be avoided, it's better to just deal with TypedArrays / Blobs instead of increasing the payload/memory with 33% more data

@Richienb
Copy link
Member

And there is also kind of already one out there that dose the same thing: hughsk/btoa-lite

This package exists because hughsk/btoa-lite#3 never ended up getting merged. hughsk/btoa-lite#3 replaced new Buffer (which throws a deprecation warning) with Buffer.from.

btoa exist everywhere now basically. it's global in nodejs since v16.

Somehow, the docs don't recommend using btoa.

also using base64 should best be avoided, it's better to just deal with TypedArrays / Blobs instead of increasing the payload/memory with 33% more data

Yes

Uhm, why did you create this?

I don't remember anymore. There might be some clues in hughsk/btoa-lite#3.
I do remember that at some point, we got the node-fetch org after planning to publish it there for a couple years, so I just went ahead with it.

So, in theory, I think this makes this package the only one to wrap the "corect" way of doing btoa. Do you wanna do anything with it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants