Last active
December 25, 2015 19:09
-
-
Save stevenschobert/7025958 to your computer and use it in GitHub Desktop.
Pattern for exporting a plain JS module (when not using AMD/CommonJS). Pulled from O'Reilly's "Programming JavaScript Applications".
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Optional object namespace | |
var app = {}; | |
(function (exports) { | |
(function (exports) { | |
// module exports | |
exports.moduleName = { | |
}; | |
}((typeof exports === 'undefined') ? | |
window : exports)); | |
}(app)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment