Skip to content

Instantly share code, notes, and snippets.

@ygotthilf
Last active August 29, 2015 14:19
Show Gist options
  • Save ygotthilf/54dd84511a8bd07d4541 to your computer and use it in GitHub Desktop.
Save ygotthilf/54dd84511a8bd07d4541 to your computer and use it in GitHub Desktop.
A module pattern that works on Browser, Node.js, Web Workers, ...
/**
* MyModule is a module that works on Browser, Node.js, Web Workers, ...
*/
(function(global) {
'use strict';
// Define your MyModule here
global.MyModule = (global.module || {}).exports = MyModule;
})(this);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment