0.0.8 • Published 4 years ago

@samuray/di v0.0.8

Weekly downloads
-
License
ISC
Repository
github
Last release
4 years ago

DI

DI container.

Example

const di = require('@samuray/di');

di.register('port', 3000);
di.factory('server', require('./server'), ['port']);

const server = di.get('server');

server.start();

DI.register(name:str, definition:any, [dependences:arraystr])

Add record (singleton) to catalog.

DI.factory(name:str, definition:function, [dependences:arraystr])

Add factory to catalog.

DI.get(name:str) -> Any

Get instance of class or record (singleton) from catalog.

0.0.8

4 years ago

0.0.7

4 years ago

0.0.6

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago