Small universal base64 functions for node.js and browsers.
Why? Universal projects deployed to browsers should not need Buffer
for base64 functionality already built into browsers (window.btoa
and window.atob
).
npm install universal-base64 --save
import { decode, encode } from "universal-base64";
encode("test"); //=> "dGVzdA=="
decode("dGVzdA=="); //=> "test"
This module uses TypeScript and contains type definitions on NPM.
Apache 2.0