Helper for creating pluggable module APIs
var use = require('hebrides');
var api = {
foo() {
return 'hello';
},
use
};
var api2 = api.use({
bar(obj, a) {
return obj.foo() + ' world' + a;
}
});
typeof api.bar //⇒ "undefined"
api2.bar('!') //⇒ "hello world!"
MIT