kellyiscute / di-example

A simpliest DI(Dependency Injection) example

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

di-example

A simpliest DI(Dependency Injection) example showing how dependency injection actually works.

How to Run

  1. Install dependency with your favorite package manager. pnpm, yarn, npm etc.
  2. Compile with tsc, then run index.js
    OR
    run index.ts with ts-node

File Structure

  • 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

About

A simpliest DI(Dependency Injection) example

License:MIT License


Languages

Language:TypeScript 100.0%