# Dependency injection

Build an app’s objects and give each one the services it needs. Scores run from 0 to 10 and are the mean of the scores of AI reviewers (Claude Opus 5.5, GPT-6.2 Sol), made on 22 November 2026 from GitHub, npm, OSV, OpenSSF Scorecard, ecosyste.ms, Hacker News and Bluesky data and a web search. The ecosyste.ms count of repositories that use a project is far too low for projects that grew in the last few years, and some reviews quote it. Overall is the reviewers' own judgement for a new project today, not an average of the parts. An AI wrote them and can be wrong.

| Rank | Project | Overall | Needed by many | Helps a lot | Holds up over time | Used widely | Vouched for | Safe | Best for |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| 1 | [Awilix](https://elestia.ai/opensource/di/awilix/index.md) | 7.5 | 4.4 | 7.9 | 7.2 | 4.5 | 6.5 | 6.7 | Node.js backend teams that want per-request scoped dependency injection without decorators, reflect-metadata or compiler settings. |
| 2 | [InversifyJS](https://elestia.ai/opensource/di/inversify/index.md) | 7.4 | 4.2 | 7.6 | 7.1 | 6.2 | 6.3 | 6.8 | Teams building large class-based TypeScript apps that want a full-featured container with scopes, contextual bindings, async resolution and an optional HTTP framework. |
| 3 | [Needle DI](https://elestia.ai/opensource/di/needle-di/index.md) | 6.3 | 4.3 | 6.9 | 5.6 | 3.1 | 3.9 | 7.7 | TypeScript or JavaScript projects that want Angular-style inject() with native decorators and no reflect-metadata, and that accept a young, single-maintainer library. |
| 4 | [injection-js](https://elestia.ai/opensource/di/injection-js/index.md) | 5.2 | 3.8 | 6.2 | 4.1 | 4.7 | 4.8 | 6.8 | Developers who know Angular and want the same provider-and-injector model in a small Node or browser app. |
| 5 | [TSyringe](https://elestia.ai/opensource/di/tsyringe/index.md) | 5.2 | 4.1 | 6.1 | 3.4 | 5.8 | 5.4 | 7.2 | Existing TypeScript codebases that already use experimentalDecorators and want a minimal constructor-injection container. |
| 6 | [Brandi](https://elestia.ai/opensource/di/brandi/index.md) | 4.7 | 3.8 | 6.4 | 3.4 | 2.2 | 2.4 | 6.3 | Small TypeScript or React projects that want type-safe DI without decorators or reflect-metadata, and that can live with a dormant upstream. |
| 7 | [TypeDI](https://elestia.ai/opensource/di/typedi/index.md) | 3.1 | 4.0 | 4.7 | 1.8 | 3.9 | 3.1 | 5.4 | Teams that already run TypeDI, for example alongside routing-controllers or TypeORM, and only need to keep it working. |

## The numbers

| Project | Downloads, 4 weeks | In a year | GitHub stars | Commits, 12 months | Last npm release | Advisories, 24 months |
| --- | --- | --- | --- | --- | --- | --- |
| Awilix | 3.6M | ×3.3 | 4.2k | 68 | Nov 2026 | 0 |
| InversifyJS | 14M | ×2.0 | 12k | 0 | Nov 2026 | 0 |
| Needle DI | 105k | ×12 | 142 | 20 | Sept 2026 | 0 |
| injection-js | 7.1M | +82% | 1.4k | 0 | Oct 2025 | 0 |
| TSyringe | 92M | ×20 | 6k | 1 | Apr 2025 | 0 |
| Brandi | 70k | ×2.2 | 228 | 4 | Jan 2026 | 0 |
| TypeDI | 3.2M | ×2.4 | 4.2k | 0 | Jan 2021 | 0 |

All categories: https://elestia.ai/opensource/index.md
