0.0.8 • Published 5 years ago

@samuray/di v0.0.8

Weekly downloads
-
License
ISC
Repository
github
Last release
5 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

5 years ago

0.0.7

5 years ago

0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago