b64-lite
Node, browser, and React Native base64 library
Usage
const b64 = ; // Base64 in ASCII to byte stringb64;// hi there // byte string to Base64 in ASCIIb64;// aGkgdGhlcmU= // convert unicode to b64b64;// aGVsbG8g5L2g5aW9 // convert a buffer to b64b64;// 5L2g5aW9 // decode b64 to unicodeb64;// hello 你好 // convert b64 to a bufferb64;// new Uint8Array([228, 189, 160, 229, 165, 189]).buffer
Can it be smaller?
If you use ES6 imports with a bundler that supports tree-shaking, yes!
License
MIT