depend
v0.0.1
Published
Dependency injection system.
Downloads
577
Readme
PolyFlow
Depend is a dependency injection system.
Usage
depend = require('depend');
depend.service('service1', function () {
return /* the service */;
});
depend.service('service2', function (service1) {
/* depends on service1 */
return /* the service */;
});
var service2 = depend.getService('service2');
Testing
depend.inject('service1', function () {
return /* mock service */
})
var service2 = depend.getService('service2');