umdjs/umd — pull request #24 by edwardhotchkiss (2013-09-23 01:30:00+00:00)
Title: [addition] added "wrapper" from @CandidBlend on Github to wrap any lib i...

**Demo:**

Example via [https://github.com/CandidBlend/wrapper](https://github.com/CandidBlend/wrapper)

`logger.js`

```javascript
wrapper('logger', [], function() {
'use strict';
var _hasConsole = (typeof(window.console) === 'object');
return {
log: function(msg) {
if (!_hasConsole) {
return;
}
var log, args;
args = Array.prototype.slice.call(arguments);
log = Function.prototype.bind.call(console.log, console);
log.apply(console, args);
}
};
});
```

`skeleton.js`

```javascript
wrapper('skeleton', ['logger'], function(Logger) {
'use strict';
function Skeleton(params) {
params = params || {};
this.name = params.name || 'default';
this.initialize();
}
Skeleton.prototype = {
initialize: function() {
Logger.log('this skeleton\'s name is %s', this.name);
}
};
return Skeleton;
});
```