It always forces to use Buffer for node.js where atob didn't exist before v16.0.0 but still not recommend. For the rest platforms: all browsers and Deno atob present for a long time. Only exception is IE 6, 7, 8 and 9. And here the question is, are you still going to support IE9?
As I understand this original part of
decodeBase64
polyfill was written 11 years ago: https://github.com/emscripten-core/emscripten/blob/4a9d5ab94f66b629b99c1104663bedbc80f799c1/src/base64Utils.js#L11Nowadays it could be simplify to this:
It always forces to use
Buffer
for node.js whereatob
didn't exist before v16.0.0 but still not recommend. For the rest platforms: all browsers and Denoatob
present for a long time. Only exception is IE 6, 7, 8 and 9. And here the question is, are you still going to support IE9?