another-injector

0.1.1 • Public • Published

Another Injector

Just another node based dependency injection tool.

Build Status

license

Install

npm install another-injector --save

Basic Injection Example

const Injector = require('another-injector');
 
class Example {
    constructor (config) {
        this.config = config;
    }
}
 
var conf = {
    animal: 'penguin',
    plane: 'f14'
};
 
var injector = new Injector();
 
injector.register('config', conf);
injector.register('example', Example);
 
var example = injector.get('example');
 
console.log(example.config);

Additional Documentation

Please check the docs.md file for further documentation at the moment. Future documentation coming for the following methods

  • inject
  • registerFiles
  • unregister
  • reset
  • list

Package Sidebar

Install

npm i another-injector

Weekly Downloads

2

Version

0.1.1

License

MIT

Last publish

Collaborators

  • kmgilbert