Simple module that converts a string to base64 (for educational purposes)
Switch branches/tags
Nothing to show
Clone or download
Latest commit 9fb08cb Jan 13, 2017
Failed to load latest commit information.
src simplify output Jan 9, 2017
.gitignore use rollup as prepublish Jan 7, 2017
LICENSE initial commit Jan 7, 2017 Update Jan 12, 2017
package.json add git repo info Jan 9, 2017
rollup.config.js use rollup as prepublish Jan 7, 2017


An ultra-basic module that just converts a string to its base64 equivalent. Designed to demonstrate how to build a JavaScript package for both Node and the browser.


npm install base64-encode-string
var b64encode = require('base64-encode-string');
b64encode('foo');    // Zm9v
b64encode('foobar'); // Zm9vYmFy


src/index.js contains the "source" JavaScript, which is then built with Rollup using a prepublish script. To see the output JS files that get shipped when you npm install, check out unpkg.