b64u-lite
isomorphic base64url library in 244 bytes
Usage
const b64u = require('b64u-lite');
b64u.toBase64Url('hi there? 你好');
b64u.toBase64Url('hi there? 你好', true);
b64u.toBase64Url(new Uint8Array([228, 189, 160, 229, 165, 189]).buffer);
b64u.toBuffer('5L2g5aW9');
b64u.fromBase64Url('aGkgdGhlcmU_IOS9oOWlvQ==');
b64u.fromBase64Url('aGkgdGhlcmU_IOS9oOWlvQ');
b64u.fromBinaryString('hi there? ');
b64u.fromBinaryString('hi there? ', true);
b64u.toBinaryString('aGkgdGhlcmU=');
Can it be smaller?
If you use ES6 imports with a bundler that supports tree-shaking, yes!
import { toBase64Url } from 'b64u-lite'
License
MIT