Created
June 21, 2011 16:28
-
-
Save ELLIOTTCABLE/1038240 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| // Well, this theoretically works in both Node.js (via `require('./page')`) and the browser (via `<script src="./page.js"></script>`). | |
| // | |
| // Since there’s no namespacing in the browser, and you can’t do `whatever_you_want = require('./page')`, we namespace it under the global variable as `ANAL.page`. | |
| (function(page){ | |
| // code | |
| return page; })( (typeof(module) !== "undefined") ? (module.exports = {}) : (ANAL = {page: {}}).page ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment