btoa-umd
About
This project is deprecated and is no longer maintained
btoa-umd
is a Javascript UMD module for btoa().
Installation for production
with Node.js
btoa-umd
is available on NPM
You can install it with the following command:
npm install btoa-umd
Browser globals and AMD
btoa-umd
is available on Bower
To install it from Bower, just run
bower install btoa-umd
Usage
Usage is pretty straightforward; in the following example, a function btoa
is created to mimic the native function with the same name:
var btoa = function (b) {
var umd = new Btoa();
return umd.handle(b).a;
};
var res = btoa('Hello World');
Then, res
will return SGVsbG8gV29ybGQ=
.
Installation for development
You also can download the whole project (and build it from its source; see below).
Either use git clone
command to get it:
git clone https://github.com/t1st3-deprecate/btoa-umd.git
Or download the latest version of the whole project.
Then, get the dependencies of the project from both Bower and NPM:
npm install
bower install
Build from source
First, see "Installation for development" above. Do not forget to get the dependencies!
Then, you also need to install Gulp globally to build the project.
npm install -g gulp
See more at the "Getting started with Gulp" page.
Once you got the dependencies and installed Gulp globally, to get info about the package from the command line, just run:
gulp info
You are now ready to build!
The source is located in the "src" folder; the built target is located in the "dist" folder.
To build, just run:
gulp build
Tests
To test, you can use either the npm test
command or the gulp test
command:
npm test
or
gulp test
Serve and livereload
You can also use the serve
task to load the html pages from ./test/
in your browser.
gulp serve
Once it has loaded the page in the browser, this task watches for any modification in the source. If changes happen in the source, the task automatically reloads the page in the browser (livereload).
License
This piece of code is triple-licensed: MIT / BSD / GPL licenses