Advertisement
Guest User

Untitled

a guest
Jul 3rd, 2015
239
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. (function (name, definition){
  2. if (typeof define === 'function'){ // AMD
  3. define(definition);
  4. } else if (typeof module !== 'undefined' && module.exports) { // Node.js
  5. module.exports = definition();
  6. } else { // Browser
  7. var theModule = definition(), global = this, old = global[name];
  8. theModule.noConflict = function () {
  9. global[name] = old;
  10. return theModule;
  11. };
  12. global[name] = theModule;
  13. }
  14. })('myModule', function () {
  15.  
  16. // return the module's API
  17. return {};
  18.  
  19. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement