depend

Dependency injection system.

npm install depend
2 downloads in the last week
8 downloads in the last month

Depend

Depend is a dependency injection system.

Installation

npm install depend

Usage

depend = require('depend');

depend.add('service1', function () {
    return /* the service */;
});

depend.add('service2', function (service1) {
    /* depends on service1 */
    return /* the service */;
});

var service2 = depend.get('service2');

Testing

depend.inject('service1', function () {
    return /* mock service */
})

var service2 = depend.get('service2');
npm loves you