cleverbox
v0.0.1
Published
Another Dependency Injection container for Node.js
Downloads
3
Readme
cleverbox
Another Dependency Injection container for Node.
Installation
$ npm install cleverbox
Features
- Module DI container
Usage
var Cleverbox = require('cleverbox');
var box = new Cleverbox(config); // See below for info about how to config the container
// So 'greeting' is a Cleverbox component, which has a dependency on
// a 'logger' component. Both of these components are defined as 'once'
// so behave like singletons within the container...
box.get('greeting', {name: 'Dave'}, function(err, greetingComponent) {
greetingComponent.sendGreetingToLogger(); // Sends 'Hello Dave!' to the logger
});