DEV Community

Discussion on: Encoding mess with Javascript

Collapse
 
antho1404 profile image
Anthony

Yes, that works well but only in node environment. In javascript in the browser, Buffer is not accessible and thus you need to go with the atob or btoa solution (if you don't want some complex webpack that can simulate a buffer or any external buffer-ish libraries).