0.0.1 • Published 8 years ago

cleverbox v0.0.1

Weekly downloads
3
License
MIT
Repository
github
Last release
8 years ago

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

});

License

MIT