UNPKG

1.01 kBtext/x-handlebars-templateView Raw
1{{! UMD template that can be useful to wrap standalone CommonJS/Node modules}}
2(function(root, factory) {
3 if(typeof exports === 'object') {
4 module.exports = factory({{#if cjsDependencies}}{{{cjsDependencies}}}, {{/if}}require, exports, module);
5 }
6 else if(typeof define === 'function' && define.amd) {
7 define({{#if amdModuleId}}'{{amdModuleId}}', {{/if}}[{{#if amdDependencies}}{{{amdDependencies}}}, {{/if}}'require', 'exports', 'module'], factory);
8 }
9 else {
10 var req = function(id) {return root[id];},
11 exp = root,
12 mod = {exports: exp};
13 {{#if globalAlias}}root['{{globalAlias}}'] = {{else}}{{#if objectToExport}}root['{{objectToExport}}'] = {{/if}}{{/if}}factory({{#if globalDependencies}}{{{globalDependencies}}}, {{/if}}req, exp, mod);
14 }
15}(this, function({{#if dependencies}}{{dependencies}}, {{/if}}require, exports, module) {
16{{{code}}}
17{{indent}}return {{#if objectToExport}}{{objectToExport}}{{else}}module.exports{{/if}};
18}));
19
\No newline at end of file