A simpliest DI(Dependency Injection) example showing how dependency injection actually works.
- Install dependency with your favorite package manager. pnpm, yarn, npm etc.
- Compile with tsc, then run
index.js
OR
runindex.ts
withts-node
- index.ts - The example usage
- decorators.ts - Decorators implementation
- dependencyTree.ts - Dependency tree analyzing
- bootstrap.ts - DI and IOC logic
- containers.ts - Instance and Module container
- types.ts - Common type declaration