Skip to content

A dependency injection framework for shared-reference development

Notifications You must be signed in to change notification settings

jpfeiffer16/DIBus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DIBus

A dependency injection framework for shared-reference development

API

Modules should be exposed in the format of an object with a name and service property. See the examples below. First require the module with var DIBus = require('dibus');

Methods

DIBus.new() - Return a new instance of the DIBus.

DIBUS.register(module) - Register a module with the DIBus it will be instantiated and injected into other modules that depend upon it in their pram list.

Examples

  var modulea = {
    name: 'a',
    service: function() {
      console.log('Module a loaded');
    }
  };
  var moduleb = {
    name: 'b',
    service: function(a) {
      console.log('Module b loaded');
      console.dir(a);
    }
  };

  var DIBus = require('dibus');

  DIBus.register(modulea);
  DIBus.register(moduleb);

About

A dependency injection framework for shared-reference development

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published