# microsoft/tsyringe

Lightweight dependency injection container for JavaScript/TypeScript

Repository: https://github.com/microsoft/tsyringe
Canonical: https://ross.abutalabs.com/products/tsyringe
Language: TypeScript
License: MIT
License Family: permissive
Topics: dependency-injection, dependency, injection, ioc, container, typescript, decorators
Last push: 2026-01-21T23:37:38+00:00

## Health v2 (maintenance only)
Score: 51/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 63, release rhythm 8, longevity 100
- inputs: {"age_days": 3212, "days_push": 224, "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 5993, forks 183 (observed 2026-08-28T04:09:34.048218+00:00)

## What it is
TSyringe is a lightweight dependency injection container for TypeScript and JavaScript supporting constructor injection via decorators. It provides singleton, scoped, and transient registrations, child containers, and injection tokens.

## Use cases
- manage dependencies in a typescript app
- ioc container for nodejs
- constructor injection with decorators
- decouple services with dependency injection
- register singletons and scoped services
- resolve interfaces without direct imports

## When to choose
- you want a small, decorator-based DI container for TypeScript
- you need child containers and scoped lifecycles
- you prefer minimal setup over a full framework like Angular or NestJS

## When to avoid
- you need a full application framework with built-in routing and modules
- you cannot enable experimental decorators or add a Reflect polyfill
- you need DI without decorators or metadata in plain JavaScript

## Facets
- artifact type: library
- maturity: stable
- function: middleware, developer-tools
- domain: developer-tools, web-development, backend
- platform: cross-platform
- tags: dependency-injection, ioc-container, decorators, constructor-injection, reflect-metadata, nodejs, typescript

## Member repositories
- microsoft/tsyringe (main) score 51

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:09:34.048218+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-29T17:49:50.961642+00:00, confidence not recorded.
  - readme: https://github.com/microsoft/tsyringe (fetched 2026-08-28T04:09:34.048218+00:00, sha dae6a0765d22)
  - registry_npm: https://registry.npmjs.org/tsyringe (fetched 2026-08-29T08:45:57.395820+00:00, sha db2c2fff2cdc)
- Data as of 2026-08-30T08:39:29.467469+00:00.
