Serenity Dependency Injection
SerenityDI is an ultra lightweight dependency injection container for Javascript. Inspiration was taken from the angular IoC, however the API is not exactly the same.
Core Differences:
- Serenity is purely a DI engine, it is not trying to be anything else
- In Serenity, YOU decide how providers are implemented (more details below)
Installation
Serenity is installable by NPM. - npm install serenitydi
Basic Usage
Functional
; serenity; serenity; //run the applicationconst service1 = serenity; ; //test will be logged
ES6 Classes
; { thisservice2 = service2; } { console; } serenity; serenity; const service = serenity; service; //logs Hello, World!