microsoft/tsyringe

Lightweight dependency injection container for JavaScript/TypeScript

View on GitHub ↗Jump to charts ↓

Summary Information

Updated 17 minutes ago
Added to GitGenius on September 11th, 2026
Created on November 17th, 2017
Open Issues & Pull Requests: 83 (+0)
GitHub issues: Enabled
Number of forks: 185
Total Stargazers: 5,998 (+0)
Total Subscribers: 40 (+0)

Repository Insights (GitGenius)

Median issue/PR response: N/A
Mean response time: 12.3 hours
90th percentile: 0.0 hours
Tracked items: 33

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Open issues: 19
New in 7 days: 1
Closed in 7 days: 0
Avg open age: 962 days
Stale 30+ days: 18
Stale 90+ days: 16

Recent activity

Opened in 7 days: 1
Closed in 7 days: 0
Comments in 7 days: 0
Events in 7 days: 0

Top labels

  • awaiting triage (21)
  • enhancement (13)
  • accepting PRs (4)
  • bug (1)
  • documentation (1)
  • wontfix (1)

Most active issues this week

No issue events were indexed in the last 7 days.

Detailed Description

TSyringe is a lightweight dependency injection container for TypeScript and JavaScript that performs constructor injection through decorators.

The tool solves the problem of managing object dependencies in applications by providing a container that automatically instantiates and injects dependencies into class constructors. It works by using TypeScript decorators and metadata reflection to track which classes need injection, what their dependencies are, and how they should be instantiated. The container supports multiple registration patterns including singletons, scoped instances, and transient objects, along with features like child containers, interception, and disposable instance lifecycle management.

Developers should choose this tool when building TypeScript or JavaScript applications that benefit from centralized dependency management and reduced coupling between components. It suits projects where constructor injection is the preferred pattern and where the overhead of a full framework is not needed. The tool requires configuring TypeScript to emit metadata and adding a Reflect API polyfill, which adds a small setup cost. For Babel users, additional configuration is necessary to ensure metadata emission. The README does not compare TSyringe to alternative dependency injection libraries, so no comparative guidance can be offered.

The project maintains active development with regular commits addressing bug fixes and feature improvements. The codebase shows consistent attention to test coverage and code quality. Documentation is comprehensive, covering common patterns like named injection, circular dependency handling, and interface-based injection. The maintainers have clearly defined non-goals, indicating a focused scope around constructor injection rather than attempting to solve broader application concerns.