awesome-repositories.com
Blog
awesome-repositories.com

Discover the best open-source repositories with AI-powered search.

ExploreCurated searchesOpen-source alternativesSelf-hosted softwareBlogSitemap
ProjectAboutHow we rankPressMCP server
LegalPrivacyTerms
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
·
microsoft avatar

microsoft/tsyringe

0
View on GitHub↗
5,960 stars·182 forks·TypeScript·MIT·3 views

Tsyringe

tsyringe is a TypeScript dependency injection container and inversion of control framework. It decouples class implementations from object creation by managing dependencies and object lifecycles using decorators and metadata.

The framework features a hierarchical container system where child containers can maintain independent registration scopes and fall back to parent containers for dependency resolution. It provides a provider system that controls object longevity through singleton and transient instantiation rules.

The system supports recursive constructor injection and handles circular dependencies using proxies. It includes capabilities for token-based registry mapping, multi-implementation resolution, and automated resource disposal for objects that implement cleanup interfaces.

Features

  • TypeScript Dependency Injection Libraries - Provides a full-featured dependency injection library tailored for TypeScript, leveraging decorators and metadata for runtime injection.
  • Dependency Lifecycle Management - Manages the acquisition and release phases of dependencies to control object longevity.
  • Hierarchical Containers - Ships a hierarchical container system where child containers maintain independent scopes and fall back to parent containers.
  • Class Registries - Maintains centralized mappings of tokens to provider definitions for dynamic lookup and instantiation.
  • Dependency Injection Frameworks - Functions as a comprehensive inversion of control framework that decouples class implementations from their instantiation logic.
  • Automatic Constructor Injection - Provides automatic provisioning of dependencies into constructors using metadata and annotations.
  • Dependency Resolution - Provides the process of retrieving and instantiating registered services from a container using unique tokens.
  • Instance Lifecycles - Controls object longevity through singleton and transient instantiation rules.
  • Dependency Metadata - Uses TypeScript decorators to store dependency requirements in class metadata for runtime retrieval.
  • Instance Lifecycles - Provides a provider system to control object longevity via singleton and transient instantiation rules.
  • Recursive Dependency Resolution - Resolves a graph of nested constructor dependencies recursively until a base instance is created.
  • Provider Mappings - Links tokens to classes, values, or factories to define how the container creates dependencies.
  • Dependency Resource Disposal - Executes registered cleanup functions for dependencies to release system resources.
  • Disposable Resource Management - Automates the cleanup of memory and connections by triggering disposal methods on container-managed objects.
  • Circular Dependency Resolvers - Implements mechanisms to break circular dependency loops by providing partially initialized references during object instantiation.
  • Resource Cleanup Utilities - Provides utilities for ensuring the deterministic release of system resources during object destruction.
  • Circular Dependency Resolution - Implements techniques for deferring component resolution to handle circular module dependencies.
  • Dependency State Management - Manages shared resources by defining dependencies as singletons or transient instances.
  • Modular Software Design - Provides a foundation for modular software design through token-based registration and decoupled component organization.
  • Container Shutdown Cleanup - Triggers cleanup methods on all objects implementing a disposable interface during container shutdown.
  • Proxy-Based Resolution - Provides proxy objects that resolve dependencies lazily to break circular dependency loops.

Star history

Star history chart for microsoft/tsyringeStar history chart for microsoft/tsyringe

AI search

Explore more awesome repositories

Describe what you need in plain English — the AI ranks thousands of curated open-source projects by relevance.

Start searching with AI

Open-source alternatives to Tsyringe

Similar open-source projects, ranked by how many features they share with Tsyringe.
  • jeffijoe/awilixjeffijoe avatar

    jeffijoe/awilix

    4,088View on GitHub↗

    Awilix is a JavaScript dependency injection framework and inversion of control container. It provides a centralized system for registering and resolving services, decoupling application components by automating how dependencies are created and passed to the functions or classes that require them. The framework features an automatic module loader that scans the filesystem using glob patterns to register dependencies based on filenames and exports. It supports parameter-name-based injection and proxy-based resolution to manage how dependencies are delivered to constructors and functions. The s

    TypeScriptawilixdependency-injectionioc
    View on GitHub↗4,088
  • typestack/typeditypestack avatar

    typestack/typedi

    4,242View on GitHub↗

    TypeDI is a TypeScript dependency injection container and inversion of control tool. It functions as a centralized registry and service locator that manages object instantiation and decouples component dependencies using type inference and decorators. The project provides scoped dependency management to isolate service instances within specific contexts, preventing data leakage between different execution flows. It supports flexible service resolution through the use of type-safe tokens and the ability to map unique identifiers or class constructors to specific service instances. The contain

    TypeScriptdependency-injectioninversion-of-controlioc
    View on GitHub↗4,242
  • swinject/swinjectSwinject avatar

    Swinject/Swinject

    6,708View on GitHub↗

    Swinject is a dependency injection framework for Swift that manages object creation and wiring through a centralized container. It resolves dependencies by looking up registered service types at runtime, supporting iOS, macOS, and Linux platforms. The framework provides multiple injection patterns, including initializer injection where dependencies are passed through initializer parameters, property injection that sets resolved dependencies on stored properties after object creation, and method injection that calls methods with resolved dependencies as arguments. It handles complex dependency

    Swiftdependency-injectiondi-containerinversion-of-control
    View on GitHub↗6,708
  • samber/dosamber avatar

    samber/do

    2,645View on GitHub↗

    This project is a type-safe dependency injection framework for Go that manages application lifecycles and injects dependencies into structures using reflection and metadata tags. It functions as a service lifecycle manager and an interface binding library to decouple service consumption from concrete implementations. The framework utilizes a hierarchical service container, organizing services into a tree of nested scopes where child containers inherit dependencies from their ancestors. It includes a dependency graph visualizer for inspecting relationships and invocation chains, as well as a s

    Gocontainerdependencydependency-graph
    View on GitHub↗2,645
See all 30 alternatives to Tsyringe→

Frequently asked questions

What does microsoft/tsyringe do?

tsyringe is a TypeScript dependency injection container and inversion of control framework. It decouples class implementations from object creation by managing dependencies and object lifecycles using decorators and metadata.

What are the main features of microsoft/tsyringe?

The main features of microsoft/tsyringe are: TypeScript Dependency Injection Libraries, Dependency Lifecycle Management, Hierarchical Containers, Class Registries, Dependency Injection Frameworks, Automatic Constructor Injection, Dependency Resolution, Instance Lifecycles.

What are some open-source alternatives to microsoft/tsyringe?

Open-source alternatives to microsoft/tsyringe include: jeffijoe/awilix — Awilix is a JavaScript dependency injection framework and inversion of control container. It provides a centralized… typestack/typedi — TypeDI is a TypeScript dependency injection container and inversion of control tool. It functions as a centralized… swinject/swinject — Swinject is a dependency injection framework for Swift that manages object creation and wiring through a centralized… samber/do — This project is a type-safe dependency injection framework for Go that manages application lifecycles and injects… inversify/inversifyjs — InversifyJS is an inversion of control framework and dependency injection library for TypeScript. It provides a… php-di/php-di — PHP-DI is an inversion of control container designed to manage object lifecycles and dependency resolution within PHP…