{"maintainers":[{"name":"jeffcarp","email":"gcarpenterv@gmail.com"}],"keywords":["atob","btoa","browser"],"dist-tags":{"latest":"1.0.3"},"author":{"name":"Jeff Carpenter","email":"gcarpenterv@gmail.com"},"description":"WHATWG spec-compliant implementations of window.atob and window.btoa.","readme":"# abab\n\n[![npm version](https://badge.fury.io/js/abab.svg)](https://www.npmjs.com/package/abab) [![Build Status](https://travis-ci.org/jsdom/abab.svg?branch=master)](https://travis-ci.org/jsdom/abab)\n\nA module that implements `window.atob` and `window.btoa` according to the [WHATWG spec](https://html.spec.whatwg.org/multipage/webappapis.html#atob). The code is originally from [w3c/web-platform-tests](https://github.com/w3c/web-platform-tests/blob/master/html/webappapis/atob/base64.html).\n\nCompatibility: Node.js version 3+ and all major browsers (using browserify or webpack)\n\nInstall with `npm`:\n\n```sh\nnpm install abab\n```\n\n## API\n\n### `btoa` (base64 encode)\n\n```js\nconst btoa = require('abab').btoa;\nbtoa('Hello, world!'); // 'SGVsbG8sIHdvcmxkIQ=='\n```\n\n### `atob` (base64 decode)\n\n```js \nconst atob = require('abab').atob;\natob('SGVsbG8sIHdvcmxkIQ=='); // 'Hello, world!'\n```\n\n#### Valid characters\n\n[Per the spec](https://html.spec.whatwg.org/multipage/webappapis.html#atob:dom-windowbase64-btoa-3), `btoa` will accept strings \"containing only characters in the range `U+0000` to `U+00FF`.\" If passed a string with characters above `U+00FF`, `btoa` will return `null`. If `atob` is passed a string that is not base64-valid, it will also return `null`. In both cases when `null` is returned, the spec calls for throwing a `DOMException` of type `InvalidCharacterError`.\n\n## Browsers\n\nIf you want to include just one of the methods to save bytes in your client-side code, you can `require` the desired module directly.\n\n```js\nvar atob = require('abab/lib/atob');\nvar btoa = require('abab/lib/btoa');\n```\n\n-----\n\n### Checklists\n\nIf you're **submitting a PR** or **deploying to npm**, please use the [checklists in CONTRIBUTING.md](https://github.com/jsdom/abab/blob/master/CONTRIBUTING.md#checklists)\n\n### Remembering `atob` vs. `btoa`\n\nHere's a mnemonic that might be useful: if you have a plain string and want to base64 encode it, then decode it, `btoa` is what you run before (**b**efore - **b**toa), and `atob` is what you run after (**a**fter - **a**tob).\n","repository":{"type":"git","url":"git+https://github.com/jsdom/abab.git"},"users":{"jeffcarp":true},"bugs":{"url":"https://github.com/jsdom/abab/issues"},"license":"ISC","versions":{"1.0.0":{"name":"abab","version":"1.0.0","description":"WHATWG spec-compliant implementations of window.atob and window.btoa.","main":"index.js","scripts":{"test":"mocha"},"repository":{"type":"git","url":"git+https://github.com/jsdom/abab.git"},"keywords":["atob","btoa","browser"],"author":{"name":"Jeff Carpenter","email":"gcarpenterv@gmail.com"},"license":"ISC","bugs":{"url":"https://github.com/jsdom/abab/issues"},"homepage":"https://github.com/jsdom/abab#readme","devDependencies":{"mocha":"^2.2.5"},"gitHead":"581865c4fe8c15c26aef3c01285bc184132bb72a","_id":"abab@1.0.0","_shasum":"744a3c2624484fa5c2393752053580aedec71b2d","_from":".","_npmVersion":"2.13.3","_nodeVersion":"3.2.0","_npmUser":{"name":"jeffcarp","email":"gcarpenterv@gmail.com"},"dist":{"shasum":"744a3c2624484fa5c2393752053580aedec71b2d","tarball":"http://nexus.dui88.com:8081/nexus/content/groups/npm-all/abab/-/abab-1.0.0.tgz"},"maintainers":[{"name":"jeffcarp","email":"gcarpenterv@gmail.com"}],"directories":{}},"1.0.1":{"name":"abab","version":"1.0.1","description":"WHATWG spec-compliant implementations of window.atob and window.btoa.","main":"index.js","files":["index.js","lib/"],"scripts":{"mocha":"mocha test/node","karma":"karma start","test":"npm run lint && npm run mocha && npm run karma","lint":"jscs . && eslint ."},"repository":{"type":"git","url":"git+https://github.com/jsdom/abab.git"},"keywords":["atob","btoa","browser"],"author":{"name":"Jeff Carpenter","email":"gcarpenterv@gmail.com"},"license":"ISC","bugs":{"url":"https://github.com/jsdom/abab/issues"},"homepage":"https://github.com/jsdom/abab#readme","devDependencies":{"babel-core":"^6.1.4","babel-loader":"^6.1.0","babel-preset-es2015":"^6.1.4","eslint":"^1.3.1","jscs":"^2.1.1","karma":"^0.13.10","karma-cli":"^0.1.1","karma-firefox-launcher":"^0.1.6","karma-mocha":"^0.2.0","karma-sauce-launcher":"^0.2.14","karma-webpack":"^1.7.0","mocha":"^2.2.5","webpack":"^1.12.2"},"gitHead":"7deb5d159e5cf31399522778beb01ef81b4cb655","_id":"abab@1.0.1","_shasum":"44e1867bb948633aa9b4c45ada44f0bb2dcce392","_from":".","_npmVersion":"2.14.4","_nodeVersion":"4.1.2","_npmUser":{"name":"jeffcarp","email":"gcarpenterv@gmail.com"},"dist":{"shasum":"44e1867bb948633aa9b4c45ada44f0bb2dcce392","tarball":"http://nexus.dui88.com:8081/nexus/content/groups/npm-all/abab/-/abab-1.0.1.tgz"},"maintainers":[{"name":"jeffcarp","email":"gcarpenterv@gmail.com"}],"directories":{}},"1.0.2":{"name":"abab","version":"1.0.2","description":"WHATWG spec-compliant implementations of window.atob and window.btoa.","main":"index.js","files":["index.js","lib/"],"scripts":{"mocha":"mocha test/node","karma":"karma start","test":"npm run lint && npm run mocha && npm run karma","lint":"jscs . && eslint ."},"repository":{"type":"git","url":"git+https://github.com/jsdom/abab.git"},"keywords":["atob","btoa","browser"],"author":{"name":"Jeff Carpenter","email":"gcarpenterv@gmail.com"},"license":"ISC","bugs":{"url":"https://github.com/jsdom/abab/issues"},"homepage":"https://github.com/jsdom/abab#readme","devDependencies":{"babel-core":"^6.1.4","babel-loader":"^6.1.0","babel-preset-es2015":"^6.1.4","eslint":"^1.3.1","jscs":"^2.1.1","karma":"^0.13.10","karma-cli":"^0.1.1","karma-firefox-launcher":"^0.1.6","karma-mocha":"^0.2.0","karma-sauce-launcher":"^0.2.14","karma-webpack":"^1.7.0","mocha":"^2.2.5","webpack":"^1.12.2"},"gitHead":"0797773407fc683fbb4d8dfd14347060ee02a250","_id":"abab@1.0.2","_shasum":"f0413a3ff7aee92e73f90f7298577457fdcb0f32","_from":".","_npmVersion":"2.14.4","_nodeVersion":"4.1.2","_npmUser":{"name":"jeffcarp","email":"gcarpenterv@gmail.com"},"dist":{"shasum":"f0413a3ff7aee92e73f90f7298577457fdcb0f32","tarball":"http://nexus.dui88.com:8081/nexus/content/groups/npm-all/abab/-/abab-1.0.2.tgz"},"maintainers":[{"name":"jeffcarp","email":"gcarpenterv@gmail.com"}],"directories":{}},"1.0.3":{"name":"abab","version":"1.0.3","description":"WHATWG spec-compliant implementations of window.atob and window.btoa.","main":"index.js","files":["index.js","lib/"],"scripts":{"mocha":"mocha test/node","karma":"karma start","test":"npm run lint && npm run mocha && npm run karma","lint":"jscs . && eslint ."},"repository":{"type":"git","url":"git+https://github.com/jsdom/abab.git"},"keywords":["atob","btoa","browser"],"author":{"name":"Jeff Carpenter","email":"gcarpenterv@gmail.com"},"license":"ISC","bugs":{"url":"https://github.com/jsdom/abab/issues"},"homepage":"https://github.com/jsdom/abab#readme","devDependencies":{"babel-core":"^6.1.4","babel-loader":"^6.1.0","babel-preset-es2015":"^6.1.4","eslint":"^1.3.1","jscs":"^2.1.1","karma":"^0.13.10","karma-cli":"^0.1.1","karma-firefox-launcher":"^0.1.6","karma-mocha":"^0.2.0","karma-sauce-launcher":"^0.2.14","karma-webpack":"^1.7.0","mocha":"^2.2.5","webpack":"^1.12.2"},"gitHead":"223c06f29e0e4d4f3bc11164f762898474158c3a","_id":"abab@1.0.3","_shasum":"b81de5f7274ec4e756d797cd834f303642724e5d","_from":".","_npmVersion":"2.14.4","_nodeVersion":"4.1.2","_npmUser":{"name":"jeffcarp","email":"gcarpenterv@gmail.com"},"dist":{"shasum":"b81de5f7274ec4e756d797cd834f303642724e5d","tarball":"http://nexus.dui88.com:8081/nexus/content/groups/npm-all/abab/-/abab-1.0.3.tgz"},"maintainers":[{"name":"jeffcarp","email":"gcarpenterv@gmail.com"}],"directories":{}}},"name":"abab","time":{"modified":"2016-01-12T01:24:59.282Z","created":"2015-09-01T22:49:15.325Z","1.0.0":"2015-09-01T22:49:15.325Z","1.0.1":"2015-11-13T23:21:16.230Z","1.0.2":"2015-12-30T22:40:50.762Z","1.0.3":"2016-01-12T01:24:59.282Z"},"readmeFilename":"README.md","homepage":"https://github.com/jsdom/abab#readme"}