Skip to content

Instantly share code, notes, and snippets.

@garystorey
Created July 30, 2014 15:36
Show Gist options
  • Select an option

  • Save garystorey/6a57f5944b796b5c92ee to your computer and use it in GitHub Desktop.

Select an option

Save garystorey/6a57f5944b796b5c92ee to your computer and use it in GitHub Desktop.
UMD for javascript
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define(['b'], factory);
} else if (typeof exports === 'object') {
module.exports = factory;
} else {
root.amdWeb = factory(root.b);
}
}(this, function (b) {
//your code here
return {};
}));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment