awesome-repositories.com
博客
MCP
awesome-repositories.com

通过 AI 驱动的搜索,发现最优秀的开源仓库。

探索精选搜索开源替代品自托管软件博客网站地图
项目关于排名机制媒体报道MCP 服务器
法律隐私政策服务条款
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
·
microsoft avatar

microsoft/tsyringe

0
View on GitHub↗
5,960 星标·182 分支·TypeScript·MIT·7 次浏览

Tsyringe

tsyringe 是一个 TypeScript 依赖注入容器和控制反转框架。它通过使用装饰器和元数据管理依赖项和对象生命周期,将类实现与对象创建解耦。

该框架具有层级容器系统,其中子容器可以维护独立的注册作用域,并回退到父容器进行依赖解析。它提供了一个通过单例和瞬态实例化规则控制对象寿命的提供程序系统。

该系统支持递归构造函数注入,并使用代理处理循环依赖。它包括用于基于令牌的注册表映射、多实现解析以及为实现清理接口的对象提供自动资源处置的功能。

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 历史

microsoft/tsyringe 的 Star 历史图表microsoft/tsyringe 的 Star 历史图表

AI 搜索

探索更多 awesome 仓库

用简单的语言描述您的需求 —— AI 将根据相关性为您从数千个精选开源项目中进行排序。

Start searching with AI

Tsyringe 的开源替代方案

相似的开源项目,按与 Tsyringe 的功能重合度排序。
  • jeffijoe/awilixjeffijoe 的头像

    jeffijoe/awilix

    4,088在 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
    在 GitHub 上查看↗4,088
  • typestack/typeditypestack 的头像

    typestack/typedi

    4,242在 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
    在 GitHub 上查看↗4,242
  • swinject/swinjectSwinject 的头像

    Swinject/Swinject

    6,708在 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
    在 GitHub 上查看↗6,708
  • samber/dosamber 的头像

    samber/do

    2,645在 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
    在 GitHub 上查看↗2,645
查看 Tsyringe 的所有 30 个替代方案→

常见问题解答

microsoft/tsyringe 是做什么的?

tsyringe 是一个 TypeScript 依赖注入容器和控制反转框架。它通过使用装饰器和元数据管理依赖项和对象生命周期,将类实现与对象创建解耦。

microsoft/tsyringe 的主要功能有哪些?

microsoft/tsyringe 的主要功能包括:TypeScript Dependency Injection Libraries, Dependency Lifecycle Management, Hierarchical Containers, Class Registries, Dependency Injection Frameworks, Automatic Constructor Injection, Dependency Resolution, Instance Lifecycles。

microsoft/tsyringe 有哪些开源替代品?

microsoft/tsyringe 的开源替代品包括: 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…