# TSyringe: 5.2 out of 10

Reasonable, with limits. 5th of 7 in [Dependency injection](https://elestia.ai/opensource/di/index.md).

TSyringe is Microsoft's small, decorator-based DI container for TypeScript. It is simple and works, but it depends on legacy experimental decorators and reflect-metadata. It has had one commit and no npm release in the last year, so it is best kept where it already runs rather than chosen for new work.

**Best for:** Existing TypeScript codebases that already use experimentalDecorators and want a minimal constructor-injection container.

## Scores

- **Overall: 5.2** (likely 4.1 to 6.2)
  - Claude Opus 5.5 (4.0): TSyringe is pleasant and small, but it is close to dormant and tied to legacy decorators that modern toolchains increasingly do not support. Awilix is actively maintained and needs no decorators, and Inversify has kept releasing and offers more features; both are better picks for new work. Keep TSyringe where it already runs.
  - GPT-6.2 Sol (6.3): TSyringe is a reasonable choice for class-heavy TypeScript projects that already emit legacy decorator metadata. Awilix is the stronger default for a new Node.js project because it works without decorators and has a much more active release and maintenance record. The upper end of the range reflects how little wiring TSyringe needs in a compatible build, while the lower end reflects uncertain support as build tools change.
- **Needed by many: 4.1** (likely 3.1 to 5.2)
  - Claude Opus 5.5 (4.0): Few JavaScript or TypeScript projects use a standalone DI container; it is mostly used by backend and large-app teams. TSyringe narrows that further to TypeScript projects that accept legacy decorators and metadata emission.
  - GPT-6.2 Sol (4.2): A container is useful when a class-heavy app has many services to construct or needs several lifetimes. Smaller apps can wire services directly, and some frameworks supply their own container. TSyringe works across frameworks, but its legacy decorator setup narrows the fit, and the State of JavaScript survey measures TypeScript use without measuring demand for standalone containers.
- **Helps a lot: 6.1** (likely 5.1 to 7.1)
  - Claude Opus 5.5 (5.0): The core features are simple and solid: constructor injection, tokens, lifecycles and child containers. It is tied to legacy decorators and reflect-metadata, has no support for standard decorators, and fails with toolchains that do not emit metadata, such as tsx and Vite. Open bugs in disposal and scoping, plus a smaller feature set than Inversify, keep it mid-range.
  - GPT-6.2 Sol (7.2): Version 4.10.0 covers everyday constructor injection well, with four lifetimes, child containers, factories, and disposal. The examples give coding agents a clear pattern to copy, but TypeScript cannot catch missing token registrations and users report runtime failures with tsx. An external benchmark found good throughput against Awilix and InversifyJS in several scenarios, though the results come from one competitor’s test suite.
- **Holds up over time: 3.4** (likely 2.4 to 4.9)
  - Claude Opus 5.5 (2.5): There was one commit and no npm release in the last year; the last publish, 4.10.0, was in April 2025. GitHub release tags stopped at v4.4.0 in 2020, and a changelog request sits untriaged. The ecosystem is moving towards standard decorators and decorator-free containers, so the project is drifting away from where TypeScript is going, even though it is not archived and sits under Microsoft.
  - GPT-6.2 Sol (4.3): The repository recorded one commit in the past year, and npm last shipped version 4.10.0 in April 2025. The library has stayed on major version 4 for years, but the open standard-decorator issue and the pull request backlog make future tooling support uncertain. Awilix shows much more recent development, and InversifyJS has published more recently.
- **Used widely: 5.8** (likely 4.4 to 7.0)
  - Claude Opus 5.5 (6.0): Downloads jumped from 4.5M to 91.8M per 4 weeks, a ratio of about 20 against a median of 4.1. That jump is almost certainly transitive, coming through packages such as @peculiar/x509 and not from developers choosing it. Dependents are a better guide: 6,704 repos and 642 packages, behind Inversify (17.6k) and injection-js (13.6k) but ahead of Awilix and TypeDI. Direct choice probably counts in the tens of thousands of projects and is not clearly growing.
  - GPT-6.2 Sol (5.6): Four-week downloads rose from 4.49 million to 91.79 million, about 20.4 times the prior year and well above the 4.1 times catalog baseline. webpack-dev-server’s move to selfsigned 5 brought in TSyringe through @peculiar/x509 and likely accounts for a substantial share of the surge. The 6,704 tracked dependent repositories put it ahead of Awilix and behind InversifyJS and injection-js. Sparse recent discussion and the unknown share of indirect installs leave growth in direct adoption uncertain.
- **Vouched for: 5.4** (likely 4.0 to 6.7)
  - Claude Opus 5.5 (4.5): It is backed by the Microsoft organisation and used by libraries such as @peculiar/x509. A few company write-ups, such as GameChanger's, report good results. There are no current survey data, independent benchmarks or framework that builds on it, and most endorsements are old.
  - GPT-6.2 Sol (6.2): Peculiar Ventures uses TSyringe in its X.509 library, Discordx maintains an integration, and Siemens lists it in SINEC NMS. Developers report that the API is simple to extend in a monorepo, alongside tooling complaints from other users. The evidence shows use in real software, while broad satisfaction and retention data remain scarce.
- **Safe: 7.2** (likely 6.1 to 8.3)
  - Claude Opus 5.5 (7.0): It has no advisories ever and a single dependency (tslib) under an MIT licence. The Scorecard of 7.2 is from 2022 and stale, with weak Maintained and Token-Permissions checks. Low maintenance means slow responses if a problem ever appears.
  - GPT-6.2 Sol (7.4): The MIT license, one declared runtime dependency, and zero recorded OSV advisories support a favorable rating. Standard setup also loads a separate Reflect polyfill. Microsoft publishes a security reporting policy, the project documents a GitHub Actions release trigger, and npm lists two maintainers. The 2022 Scorecard flagged token permissions and fuzzing, and sparse recent releases leave current publishing controls and patch response uncertain.

## Good

- Very small API: @injectable(), @inject() and container.resolve() cover most needs with little setup.
- Only one runtime dependency (tslib), an MIT licence and no known advisories.
- Child containers, scoped lifecycles and token-based injection cover typical app and test needs.
- It sits in the Microsoft GitHub organisation and is well represented in tutorials and AI training data.

## Bad

- It needs experimentalDecorators, emitDecoratorMetadata and a reflect-metadata polyfill, and it does not support TC39 standard decorators.
- Maintenance has nearly stopped: one commit and no npm release in the last year, and many issues are still awaiting triage.
- Users report open problems with tsx, Vite and other esbuild-based toolchains, which do not emit decorator metadata.
- There are known open bugs around disposal and resolution scopes, such as #274, #285 and #289.

## The numbers

- Downloads, 4 weeks: 92M
- In a year: ×20
- GitHub stars: 6k
- Commits, 12 months: 1
- Last npm release: Apr 2025
- Advisories, 24 months: 0
- Licence: MIT
- GitHub: https://github.com/microsoft/tsyringe
- npm: https://www.npmjs.com/package/tsyringe

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.
