Implementations based on reflect-metadata
- Inversify
- tsyringe
- typedi
- injection-js, an extraction of DI of Angular 4 and below, though it could be used without reflect-metadata, the syntax would be verbose
- vscode
- redi
- @tencent/wedi
- service-compoistion, whose author also writes reflect-metadata
A benefit of using reflect-metadata is that you don't have to declare dependency for classes.
Say
@Injectable
class A {
constructor(private readonly b: B) {}
}
The injector will know that A
depends on B
.
Compare to
class A {
constructor(@Need(B) private readonly: B) {}
}