Skip to content

Commit

Permalink
Add module.exports (#32)
Browse files Browse the repository at this point in the history
* Add module.exporrs

* Added export check and amd export according to http://www.matteoagosti.com/blog/2013/02/24/writing-javascript-modules-for-both-browser-and-node/
  • Loading branch information
rejas authored and georgemandis committed Jun 14, 2017
1 parent 21283d9 commit 72aa22e
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions konami.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,3 +113,16 @@ var Konami = function (callback) {

return konami;
};


if (typeof module !== 'undefined' && typeof module.exports !== 'undefined') {
module.exports = Konami;
} else {
if (typeof define === 'function' && define.amd) {
define([], function() {
return Konami;
});
} else {
window.Konami = Konami;
}
}

0 comments on commit 72aa22e

Please sign in to comment.