# typestack/typedi

Simple yet powerful dependency injection tool for JavaScript and TypeScript.

Repository: https://github.com/typestack/typedi
Canonical: https://ross.abutalabs.com/products/typedi
Homepage: https://docs.typestack.community/typedi/v/develop/01-getting-started
Language: TypeScript
License: MIT
License Family: permissive
Topics: dependency-injection, typescript, inversion-of-control, ioc, typedi
Last push: 2025-10-29T09:01:43+00:00

## Health v2 (maintenance only)
Score: 45/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 49, release rhythm 8, longevity 100
- inputs: {"age_days": 3991, "days_push": 308, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 4243, forks 166 (observed 2026-08-28T04:08:40.313269+00:00)

## What it is
TypeDI is a dependency injection library for TypeScript and JavaScript that manages service registration, resolution, and lifecycle via decorators and containers. It supports constructor and property injection, singleton and transient services, and multiple or scoped containers.

## Use cases
- add dependency injection to a TypeScript Node.js app
- inject services with decorators instead of manual wiring
- swap fake dependencies in unit tests
- manage singleton and transient service lifecycles
- use multiple or scoped DI containers
- structure a large codebase with inversion of control

## When to choose
- you use TypeScript with decorators and want decorator-based DI
- you want a lightweight, well-tested DI container for Node or browser
- you need named services, factories, or scoped containers
- you want easily testable classes with injectable dependencies

## When to avoid
- you want zero-config DI without reflect-metadata and tsconfig changes
- you prefer functional composition over class-based patterns
- you need DI features like interface-only binding without tokens
- your project is plain JavaScript and needs full decorator ergonomics

## Facets
- artifact type: library
- maturity: stable
- function: middleware, developer-tools
- domain: developer-tools, backend, web-development
- platform: browser, cross-platform
- tags: dependency-injection, inversion-of-control, ioc-container, decorators, service-locator, singleton, testability, nodejs, typescript

## Member repositories
- typestack/typedi (main) score 45

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:08:40.313269+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T18:22:14.169927+00:00, confidence not recorded.
  - readme: https://github.com/typestack/typedi (fetched 2026-08-28T04:08:40.313269+00:00, sha 64f78ed1a343)
  - homepage: https://docs.typestack.community/typedi/v/develop/01-getting-started (fetched 2026-08-29T09:12:19.390275+00:00, sha 7e762fc84e67)
  - site_page: https://docs.typestack.community/typedi/develop (fetched 2026-08-29T09:12:19.392859+00:00, sha 18fcde69b743)
  - site_page: https://docs.typestack.community/typedi/develop/usage-without-typescript/01-getting-started (fetched 2026-08-29T09:12:19.395019+00:00, sha e9164237a0ed)
- Data as of 2026-08-30T08:39:29.467469+00:00.
