[
  {
    "path": ".gitignore",
    "content": "# Created by https://www.gitignore.io/api/node\n\n### Node ###\n# Logs\nlogs\n*.log\nnpm-debug.log*\n\n# Runtime data\npids\n*.pid\n*.seed\n\n# Directory for instrumented libs generated by jscoverage/JSCover\nlib-cov\n\n# Coverage directory used by tools like istanbul\ncoverage\n\n# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)\n.grunt\n\n# node-waf configuration\n.lock-wscript\n\n# Compiled binary addons (http://nodejs.org/api/addons.html)\nbuild/Release\n\n# Dependency directory\n# https://docs.npmjs.com/misc/faq#should-i-check-my-node-modules-folder-into-git\nnode_modules\n\n"
  },
  {
    "path": ".travis.yml",
    "content": "language: node_js\nnode_js:\n  - \"stable\"\nsudo: false\n"
  },
  {
    "path": "CHANGES",
    "content": "\nv2.0.0\n\n\t* jQuery is now provided by only one template. This template normalizes how\n\t  modules built with it are used in CommonJS environments:\n\n\t\t\trequire('./myJqueryPlugin')(window, [jQuery]);\n\n\n\t\tProviding window is mandated. This is because jQuery upstream,\n\n\t\t\t1. Sometimes returns a factory, and only sometimes.\n\t\t\t2. We *always* have access to window.\n\t\t\t3. It makes the use of window explicit.\n\t\t\t4. If jQuery ever provides access to the factory we are forward-compatable.\n\n\t\tFor more information on this, read\n\n\t\t\t* http://stackoverflow.com/q/33404108/124486\n\t\t\t* https://github.com/umdjs/umd/issues/68\n\t\n"
  },
  {
    "path": "LICENSE.md",
    "content": "The MIT License (MIT)\n\nCopyright (c) 2014 the [UMD contributors](https://github.com/umdjs/umd/graphs/contributors).\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "README.md",
    "content": "## UMD (Universal Module Definition)\n\n[![Build Status](https://travis-ci.org/umdjs/umd.svg)](https://travis-ci.org/umdjs/umd)\n\nThis repository formalizes the design and implementation of the Universal Module Definition (UMD) API for JavaScript modules. These are modules which are capable of working everywhere, be it in the client, on the server or elsewhere.\n\nThe UMD pattern typically attempts to offer compatibility with the most popular script loaders of the day (e.g RequireJS amongst others). The repository aims to formalize the *definition* of *universal modules*. It does not provide a *universal definition*. The standard was written at the time because everyone defined their universal modules differently - there were some common approaches, with varying support for different environments, but nothing really established.\n\nA universal module, as already noted, works in multiple environments. Before universal modules, libraries would distribute separate files for the different environments, e.g. `library.amd.js`, `library.common.js` and `library.global.js`. This was a hassle for maintainers, since it required the usage of a build tool (which JavaScript <s>does</s> did generally not need) and extra documentation. So the aim was to define a universal module, a single file, which was all that was needed for the author to write and distribute and for the user to (down)load. Notice this was before package managers and repositories were common (or: when they started to become more popular, and you had to change your library into a module to support them).\n\nYet, there were still variations. Modules written for web browsers did not need to consider supporting the commonjs format, as they wouldn't work in Node.JS anyway. Modules that had no dependencies wouldn't need a UMD pattern that supported `require`. Modules that did not use circular dependencies wouldn't need a pattern that supports a mutable `exports` object. You can find the explanation of these differences, and their trade-offs, in the comments documenting the patterns below. A library author can read through them and pick the right one for their supported environments.\n\nIn many cases, UMD uses [AMD](https://github.com/amdjs/amdjs-api/wiki/AMD) as a base, with special-casing added to handle [CommonJS](http://wiki.commonjs.org/wiki/CommonJS) compatibility.\n\n### Variations\n\n#### Regular Module\n\n* [amdWeb.js](https://github.com/umdjs/umd/blob/master/templates/amdWeb.js) -\n  Defines a module that works with AMD and browser globals. If you also want\n  to export a global even when AMD is in play (useful if you are loading other\n  scripts that still expect that global), use\n  [amdWebGlobal.js](https://github.com/umdjs/umd/blob/master/templates/amdWebGlobal.js).\n* [returnExports.js](https://github.com/umdjs/umd/blob/master/templates/returnExports.js) -\n  Defines a module that works in Node, AMD and browser globals. If you also want\n  to export a global even when AMD is in play (useful if you are loading other\n  scripts that still expect that global), use\n  [returnExportsGlobal.js](https://github.com/umdjs/umd/blob/master/templates/returnExportsGlobal.js).\n* [commonjsStrict.js](https://github.com/umdjs/umd/blob/master/templates/commonjsStrict.js) -\n  Defines a module that works with more CommonJS runtimes, and for modules that\n  will have a circular dependency. If you also want\n  to export a global even when AMD is in play (useful if you are loading other\n  scripts that still expect that global), use\n  [commonjsStrictGlobal.js](https://github.com/umdjs/umd/blob/master/templates/commonjsStrictGlobal.js)\n\n#### jQuery Plugin\n\n* [jqueryPlugin.js](https://github.com/umdjs/umd/blob/master/templates/jqueryPlugin.js) -\n  Defines a jQuery plugin that works with AMD and browser globals.\n\n#### AMD with simple Node/CommonJS adapter\n\nThese are useful for using AMD style while still making modules that can be\nused in Node and installed via npm without extra dependencies to set up the\nfull AMD API.\n\nThis approach does not allow the use of [AMD loader plugins](https://github.com/amdjs/amdjs-api/wiki/Loader-Plugins),\njust basic JS module dependencies. It also does not support the\n[callback-style require](https://github.com/amdjs/amdjs-api/wiki/require) that\nis usable in AMD.\n\n* [nodeAdapter.js](https://github.com/umdjs/umd/blob/master/templates/nodeAdapter.js) -\n  Best for when using AMD style but want it to work in Node without a helper library\n  that sets up AMD.\n* [commonjsAdapter.js](https://github.com/umdjs/umd/blob/master/templates/commonjsAdapter.js) -\n  Similar to nodeAdapter.js, but compatible with more CommonJS runtimes, and if\n  you want to define a circular dependency.\n\n### Tooling\n\n#### Build tools\n\n* [docpad-plugin-umd](https://github.com/docpad/docpad-plugin-umd) is a [DocPad](http://docpad.org) plugin for surrounding JavaScript code with UMD boilerplate\n* [grunt-umd](https://github.com/alexlawrence/grunt-umd) is a [Grunt](http://gruntjs.com) task for surrounding JavaScript code with UMD boilerplate\n* [gulp-umd](https://github.com/eduardolundgren/gulp-umd) is a [Gulp](http://gulpjs.com/) task for surrounding JavaScript code with UMD boilerplate\n* [grunt-urequire](https://github.com/aearly/grunt-urequire) is a Grunt wrapper for [uRequire](https://github.com/anodynos/uRequire) a conversion tool for universal JavaScript modules.\n* [generator-umd](https://github.com/ruyadorno/generator-umd) is an Yeoman Generator that creates a single module project with UMD boilerplate\n\n\n#### Testing\n\n* [Unit testing UMD with grunt-contrib-jasmine](http://stackoverflow.com/questions/16940548/grunt-test-for-umd)\n\n### Resources\n\n* [Browserify and the Universal Module Definition](http://dontkry.com/posts/code/browserify-and-the-universal-module-definition.html)\n\n### Todos\n\n* noConflict. Although with AMD loaders and build tools, it should be possible to get version specific bindings,\n  maybe show a version that has a noConflict option.\n* Variation with attaching some functionality to a $ impersonator. Although, it is\ntempting to say for that case, ask for 'jquery' as a dependency, and if the developer\nwants to use something different than the actual 'jquery', map that file to the 'jquery' name.\nThat is one of the strengths of module names, they can be mapped to different implementations.\n* Usage examples\n    * Further justifications for usage\n    * Gotchas/custom-tweaks we're aware of, but would rather not apply to the default UMD boilerplate\n\n### Influences\n\nThe basic pattern for the UMD variations in this repository was derived from the approach [@kriskowal](https://github.com/kriskowal) used for the [Q promise library](https://github.com/kriskowal/q).\n\nEarlier UMD variations were also of influence, ranging from Kit-Cambridge's\n[UMD](https://gist.github.com/1251221), through to [patterns](https://github.com/addyosmani/jquery-plugin-patterns/issues/1) discussed by Addy Osmani, Thomas Davis and Ryan Florence and most recently the UMD patterns proposed by [James Burke](https://gist.github.com/1262861).\n\n### License\n\nCopyright (c) the UMD contributors\n\nLicensed under the [MIT License](https://github.com/umdjs/umd/blob/master/LICENSE.md).\n"
  },
  {
    "path": "package.json",
    "content": "{\n  \"name\": \"umdjs\",\n  \"version\": \"2.0.0\",\n  \"description\": \"UMD (Universal Module Definition)\",\n  \"main\": \"amdWeb.js\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/umdjs/umd\"\n  },\n  \"keywords\": [\n    \"umd\",\n    \"umdjs\",\n    \"universal\",\n    \"module\",\n    \"definition\"\n  ],\n  \"author\": \"The UMD Authors\",\n  \"license\": \"MIT\",\n  \"bugs\": {\n    \"url\": \"https://github.com/umdjs/umd/issues\"\n  },\n  \"homepage\": \"https://github.com/umdjs/umd\",\n  \"scripts\": {\n    \"test\": \"npm run lint\",\n    \"lint\": \"jshint templates/*.js\"\n  },\n  \"devDependencies\": {\n    \"jshint\": \"^2.8.0\"\n  },\n  \"dependencies\": {\n    \"jquery\": \"^2.1.4\"\n  }\n}\n"
  },
  {
    "path": "templates/amdWeb.js",
    "content": "// Uses AMD or browser globals to create a module.\n\n// If you want something that will also work in Node, see returnExports.js\n// If you want to support other stricter CommonJS environments,\n// or if you need to create a circular dependency, see commonJsStrict.js\n\n// Defines a module \"amdWeb\" that depends on another module called \"b\".\n// Note that the name of the module is implied by the file name. It is best\n// if the file name and the exported global have matching names.\n\n// If the 'b' module also uses this type of boilerplate, then\n// in the browser, it will create a global .b that is used below.\n\n// If you do not want to support the browser global path, then you\n// can remove the `root` use and the passing of `this` as the first arg to\n// the top function.\n\n(function (root, factory) {\n    if (typeof define === 'function' && define.amd) {\n        // AMD. Register as an anonymous module.\n        define(['b'], factory);\n    } else {\n        // Browser globals\n        root.amdWeb = factory(root.b);\n    }\n}(typeof self !== 'undefined' ? self : this, function (b) {\n    // Use b in some fashion.\n\n    // Just return a value to define the module export.\n    // This example returns an object, but the module\n    // can return a function as the exported value.\n    return {};\n}));\n"
  },
  {
    "path": "templates/amdWebGlobal.js",
    "content": "// Uses AMD or browser globals to create a module. This example creates a\n// global even when AMD is used. This is useful if you have some scripts\n// that are loaded by an AMD loader, but they still want access to globals.\n// If you do not need to export a global for the AMD case, see amdWeb.js.\n\n// If you want something that will also work in Node, and still export a\n// global in the AMD case, see returnExportsGlobal.js\n// If you want to support other stricter CommonJS environments,\n// or if you need to create a circular dependency, see commonJsStrictGlobal.js\n\n// Defines a module \"amdWebGlobal\" that depends another module called \"b\".\n// Note that the name of the module is implied by the file name. It is best\n// if the file name and the exported global have matching names.\n\n// If the 'b' module also uses this type of boilerplate, then\n// in the browser, it will create a global .b that is used below.\n\n(function (root, factory) {\n    if (typeof define === 'function' && define.amd) {\n        // AMD. Register as an anonymous module.\n        define(['b'], function (b) {\n            // Also create a global in case some scripts\n            // that are loaded still are looking for\n            // a global even when an AMD loader is in use.\n            return (root.amdWebGlobal = factory(b));\n        });\n    } else {\n        // Browser globals\n        root.amdWebGlobal = factory(root.b);\n    }\n}(typeof self !== 'undefined' ? self : this, function (b) {\n    // Use b in some fashion.\n\n    // Just return a value to define the module export.\n    // This example returns an object, but the module\n    // can return a function as the exported value.\n    return {};\n}));\n"
  },
  {
    "path": "templates/commonjsAdapter.js",
    "content": "// Defines a module that works in CommonJS and AMD.\n\n// This version can be used as common boilerplate for a library module\n// that you only want to expose to CommonJS and AMD loaders. It will not work\n// well for defining browser globals.\n\n// If you only want to target Node and AMD or a CommonJS environment that\n// supports assignment to module.exports and you are not defining a module\n// that has a circular dependency, see nodeAdapter.js\n\n// Help Node out by setting up define.\nif (typeof exports === 'object' && typeof exports.nodeName !== 'string' && typeof define !== 'function') {\n    var define = function (factory) {\n        factory(require, exports, module);\n    };\n}\n\ndefine(function (require, exports, module) {\n    var b = require('b');\n\n    // Only attach properties to the exports object to define\n    // the module's properties.\n    exports.action = function () {};\n});\n"
  },
  {
    "path": "templates/commonjsStrict.js",
    "content": "// Uses CommonJS, AMD or browser globals to create a module.\n\n// If you just want to support Node, or other CommonJS-like environments that\n// support module.exports, and you are not creating a module that has a\n// circular dependency, then see returnExports.js instead. It will allow\n// you to export a function as the module value.\n\n// Defines a module \"commonJsStrict\" that depends another module called \"b\".\n// Note that the name of the module is implied by the file name. It is best\n// if the file name and the exported global have matching names.\n\n// If the 'b' module also uses this type of boilerplate, then\n// in the browser, it will create a global .b that is used below.\n\n// If you do not want to support the browser global path, then you\n// can remove the `root` use and the passing `this` as the first arg to\n// the top function.\n\n(function (root, factory) {\n    if (typeof define === 'function' && define.amd) {\n        // AMD. Register as an anonymous module.\n        define(['exports', 'b'], factory);\n    } else if (typeof exports === 'object' && typeof exports.nodeName !== 'string') {\n        // CommonJS\n        factory(exports, require('b'));\n    } else {\n        // Browser globals\n        factory((root.commonJsStrict = {}), root.b);\n    }\n}(typeof self !== 'undefined' ? self : this, function (exports, b) {\n    // Use b in some fashion.\n\n    // attach properties to the exports object to define\n    // the exported module properties.\n    exports.action = function () {};\n}));\n"
  },
  {
    "path": "templates/commonjsStrictGlobal.js",
    "content": "// Uses CommonJS, AMD or browser globals to create a module. This example\n// creates a global even when AMD is used. This is useful if you have some\n// scripts that are loaded by an AMD loader, but they still want access to\n// globals. If you do not need to export a global for the AMD case, see\n// commonjsStrict.js.\n\n// If you just want to support Node, or other CommonJS-like environments that\n// support module.exports, and you are not creating a module that has a\n// circular dependency, then see returnExportsGlobal.js instead. It will allow\n// you to export a function as the module value.\n\n// Defines a module \"commonJsStrictGlobal\" that depends another module called\n// \"b\". Note that the name of the module is implied by the file name. It is\n// best if the file name and the exported global have matching names.\n\n// If the 'b' module also uses this type of boilerplate, then\n// in the browser, it will create a global .b that is used below.\n\n(function (root, factory) {\n    if (typeof define === 'function' && define.amd) {\n        // AMD. Register as an anonymous module.\n        define(['exports', 'b'], function (exports, b) {\n            factory((root.commonJsStrictGlobal = exports), b);\n        });\n    } else if (typeof exports === 'object' && typeof exports.nodeName !== 'string') {\n        // CommonJS\n        factory(exports, require('b'));\n    } else {\n        // Browser globals\n        factory((root.commonJsStrictGlobal = {}), root.b);\n    }\n}(typeof self !== 'undefined' ? self : this, function (exports, b) {\n    // Use b in some fashion.\n\n    // attach properties to the exports object to define\n    // the exported module properties.\n    exports.action = function () {};\n}));\n"
  },
  {
    "path": "templates/jqueryPlugin.js",
    "content": "// Uses CommonJS, AMD or browser globals to create a jQuery plugin.\n\n(function (factory) {\n    if (typeof define === 'function' && define.amd) {\n        // AMD. Register as an anonymous module.\n        define(['jquery'], factory);\n    } else if (typeof module === 'object' && module.exports) {\n        // Node/CommonJS\n        module.exports = function( root, jQuery ) {\n            if ( jQuery === undefined ) {\n                // require('jQuery') returns a factory that requires window to\n                // build a jQuery instance, we normalize how we use modules\n                // that require this pattern but the window provided is a noop\n                // if it's defined (how jquery works)\n                if ( typeof window !== 'undefined' ) {\n                    jQuery = require('jquery');\n                }\n                else {\n                    jQuery = require('jquery')(root);\n                }\n            }\n            factory(jQuery);\n            return jQuery;\n        };\n    } else {\n        // Browser globals\n        factory(jQuery);\n    }\n}(function ($) {\n    $.fn.jqueryPlugin = function () { return true; };\n}));\n"
  },
  {
    "path": "templates/nodeAdapter.js",
    "content": "// Defines a module that works in Node and AMD.\n\n// This version can be used as common boilerplate for a library module\n// that you only want to expose to Node and AMD loaders. It will not work\n// well for defining browser globals.\n\n// If you need a version of this file that works CommonJS-like environments\n// that do not support module.exports or if you want to define a module\n// with a circular dependency, see commonjsAdapter.js\n\n(function(define) {\n\n    define(function (require, exports, module) {\n        var b = require('b');\n\n        return function () {};\n    });\n\n}( // Help Node out by setting up define.\n    typeof module === 'object' && module.exports && typeof define !== 'function' ?\n    function (factory) { module.exports = factory(require, exports, module); } :\n    define\n));\n\n"
  },
  {
    "path": "templates/returnExports.js",
    "content": "// Uses Node, AMD or browser globals to create a module.\n\n// If you want something that will work in other stricter CommonJS environments,\n// or if you need to create a circular dependency, see commonJsStrict.js\n\n// Defines a module \"returnExports\" that depends another module called \"b\".\n// Note that the name of the module is implied by the file name. It is best\n// if the file name and the exported global have matching names.\n\n// If the 'b' module also uses this type of boilerplate, then\n// in the browser, it will create a global .b that is used below.\n\n// If you do not want to support the browser global path, then you\n// can remove the `root` use and the passing `this` as the first arg to\n// the top function.\n\n(function (root, factory) {\n    if (typeof define === 'function' && define.amd) {\n        // AMD. Register as an anonymous module.\n        define(['b'], factory);\n    } else if (typeof module === 'object' && module.exports) {\n        // Node. Does not work with strict CommonJS, but\n        // only CommonJS-like environments that support module.exports,\n        // like Node.\n        module.exports = factory(require('b'));\n    } else {\n        // Browser globals (root is window)\n        root.returnExports = factory(root.b);\n    }\n}(typeof self !== 'undefined' ? self : this, function (b) {\n    // Use b in some fashion.\n\n    // Just return a value to define the module export.\n    // This example returns an object, but the module\n    // can return a function as the exported value.\n    return {};\n}));\n\n\n// if the module has no dependencies, the above pattern can be simplified to\n(function (root, factory) {\n    if (typeof define === 'function' && define.amd) {\n        // AMD. Register as an anonymous module.\n        define([], factory);\n    } else if (typeof module === 'object' && module.exports) {\n        // Node. Does not work with strict CommonJS, but\n        // only CommonJS-like environments that support module.exports,\n        // like Node.\n        module.exports = factory();\n    } else {\n        // Browser globals (root is window)\n        root.returnExports = factory();\n  }\n}(typeof self !== 'undefined' ? self : this, function () {\n\n    // Just return a value to define the module export.\n    // This example returns an object, but the module\n    // can return a function as the exported value.\n    return {};\n}));\n"
  },
  {
    "path": "templates/returnExportsGlobal.js",
    "content": "// Uses Node, AMD or browser globals to create a module. This example creates\n// a global even when AMD is used. This is useful if you have some scripts\n// that are loaded by an AMD loader, but they still want access to globals.\n// If you do not need to export a global for the AMD case,\n// see returnExports.js.\n\n// If you want something that will work in other stricter CommonJS environments,\n// or if you need to create a circular dependency, see commonJsStrictGlobal.js\n\n// Defines a module \"returnExportsGlobal\" that depends another module called\n// \"b\". Note that the name of the module is implied by the file name. It is\n// best if the file name and the exported global have matching names.\n\n// If the 'b' module also uses this type of boilerplate, then\n// in the browser, it will create a global .b that is used below.\n\n(function (root, factory) {\n    if (typeof define === 'function' && define.amd) {\n        // AMD. Register as an anonymous module.\n        define(['b'], function (b) {\n            return (root.returnExportsGlobal = factory(b));\n        });\n    } else if (typeof module === 'object' && module.exports) {\n        // Node. Does not work with strict CommonJS, but\n        // only CommonJS-like environments that support module.exports,\n        // like Node.\n        module.exports = factory(require('b'));\n    } else {\n        // Browser globals\n        root.returnExportsGlobal = factory(root.b);\n    }\n}(typeof self !== 'undefined' ? self : this, function (b) {\n    // Use b in some fashion.\n\n    // Just return a value to define the module export.\n    // This example returns an object, but the module\n    // can return a function as the exported value.\n    return {};\n}));\n"
  }
]