Skip to content

Instantly share code, notes, and snippets.

@ELLIOTTCABLE
Created June 21, 2011 16:28
Show Gist options
  • Select an option

  • Save ELLIOTTCABLE/1038240 to your computer and use it in GitHub Desktop.

Select an option

Save ELLIOTTCABLE/1038240 to your computer and use it in GitHub Desktop.
// 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