npm

npm’s 2019 JavaScript ecosystem survey analysis is now available! Get your copy here »

b64-lite

1.3.1 • Public • Published

b64-lite NPM Build

Node, browser (152 bytes), and React Native base64 library

Usage

const b64 = require('b64-lite');
 
// Base64 in ASCII to byte string
b64.atob('aGkgdGhlcmU=');
// hi there
 
// byte string to Base64 in ASCII
b64.btoa('hi there');
// aGkgdGhlcmU=
 
// convert unicode to b64
b64.toBase64('hello 你好');
// aGVsbG8g5L2g5aW9
 
// decode b64 to unicode
b64.fromBase64('aGVsbG8g5L2g5aW9');
// hello 你好

Can it be smaller?

If you use ES6 imports with a bundler that supports tree-shaking, yes!

import { toBase64 } from 'b64-lite'

License

MIT

install

npm i b64-lite

Downloadsweekly downloads

510

version

1.3.1

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability