diff --git a/browser-atob.js b/browser-atob.js index 95ff45b..f5fc8bc 100644 --- a/browser-atob.js +++ b/browser-atob.js @@ -6,7 +6,7 @@ function atob(str) { // normal window if ('function' === typeof a2b) { - return a2b(a2b); + return a2b(str); } // browserify (web worker) else if ('function' === typeof Buffer) { @@ -29,4 +29,8 @@ } w.atob = atob; + + if (typeof module !== 'undefined') { + module.exports = atob; + } }(window)); diff --git a/test.js b/test.js index f8903d0..e499dd5 100644 --- a/test.js +++ b/test.js @@ -2,7 +2,7 @@ (function () { "use strict"; - var atob = require('./index') + var atob = require('.') , encoded = "SGVsbG8gV29ybGQ=" , unencoded = "Hello World" /*