For a dependency injection library for TypeScript, the first results are inversify/inversifyjs (InversifyJS is a comprehensive TypeScript-native dependency injection container that natively supports decorator-based injection, constructor injection, scope management, and asynchronous resolution), typestack/typedi (TypeDI is a comprehensive TypeScript dependency injection container that natively supports decorator-based injection, constructor injection, and advanced scope management for service lifecycles) and microsoft/tsyringe (This is a comprehensive TypeScript-native dependency injection container that natively supports decorator-based injection, constructor injection, hierarchical scope management, and lifecycle control). jeffijoe/awilix and midwayjs/midway round out the shortlist. Compare the match explanations and check the project documentation against your requirements.
We curate open-source GitHub repositories matching “best typescript dependency injection libraries”. Results are ranked by relevance to your query — pick filters below to narrow, or refine with AI.
InversifyJS is an inversion of control framework and dependency injection library for TypeScript. It provides a centralized container to manage object lifecycles and automate the instantiation of classes and their dependencies. The library decouples software components by mapping unique identifiers to concrete implementations. This architecture separates object creation from business logic and allows for the replacement of real service implementations with mock objects during unit testing. The framework utilizes TypeScript decorators to provide metadata-driven injection and recursive depende
InversifyJS is a comprehensive TypeScript-native dependency injection container that natively supports decorator-based injection, constructor injection, scope management, and asynchronous resolution.
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
TypeDI is a comprehensive TypeScript dependency injection container that natively supports decorator-based injection, constructor injection, and advanced scope management for service lifecycles.
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
This is a comprehensive TypeScript-native dependency injection container that natively supports decorator-based injection, constructor injection, hierarchical scope management, and lifecycle control.
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
Awilix is a robust dependency injection container for TypeScript that supports constructor injection, scope management, and inversion of control, though it favors parameter-name-based resolution over the decorator-based approach common in other frameworks.
Midway is a suite of backend frameworks for Node.js designed to build enterprise microservices and full-stack applications. It centers on a dependency injection architecture using an inversion-of-control container and decorators to organize complex business logic and maintainable server-side structures. The framework provides multi-protocol support for HTTP, gRPC, and WebSockets, allowing a single environment to handle diverse service-to-service networking requirements. It also includes a multi-runtime adapter layer that enables applications to be deployed across traditional containers and va
Midway is a full-stack backend framework that centers its architecture on a robust, decorator-based inversion-of-control container, making it a comprehensive choice for managing service lifecycles and decoupling in TypeScript applications.
Nest is a server-side framework for building scalable and maintainable enterprise-grade applications using TypeScript. It provides a modular architecture that organizes code into encapsulated, reusable modules, utilizing a dependency injection container to manage object lifecycles and resolve component dependencies through declarative metadata. The framework distinguishes itself through a platform-agnostic abstraction layer that decouples core logic from underlying HTTP servers, allowing for flexible implementation choices. It employs a middleware-based request pipeline that processes traffic
Nest is a comprehensive server-side framework that features a robust, decorator-based dependency injection container as its core architectural component for managing object lifecycles and service decoupling.
This project is a functional programming library and toolkit for building production TypeScript applications. It provides a system for managing concurrency, error handling, and resource lifecycles using functional effects. The project distinguishes itself through a comprehensive suite of specialized toolkits, including a dependency injection framework for decoupling service implementations, a workflow orchestrator for coordinating durable processes, and a SQL database toolkit for consistent data operations across multiple dialects. It also implements an OpenTelemetry instrumentation library f
This library provides a robust dependency injection system based on functional programming principles and service providers, offering a powerful alternative to traditional decorator-based containers for managing object lifecycles and service decoupling.
Implementation of a bulletproof node.js API 🛡️
This repository is a boilerplate project for building Node.js APIs that happens to utilize dependency injection libraries like TypeDI, rather than being a dependency injection container library itself.
Prism is a XAML application framework and MVVM architectural framework designed to build loosely coupled and testable applications across WPF, Xamarin Forms, and WinUI. It serves as a structural pattern implementation that separates business logic from the user interface to improve maintainability and testing. The framework provides a XAML event bus for exchanging data and triggering actions between independent components without direct coupling. It also functions as a dependency injection integrator, bridging external inversion-of-control containers to manage service delivery across multiple
This is a C# framework for building XAML-based desktop and mobile applications, not a TypeScript-native library for dependency injection.
QFramework is a Unity game architecture framework designed to separate presentation, system, and data logic. It implements a layered software architecture to manage complex game states and provides a game engine utility library to reduce boilerplate code. The framework is centered on the Command Query Responsibility Segregation pattern, which separates data modification commands from data retrieval queries. It utilizes a dependency injection container to manage the lifecycles and resolution of singletons and modular components, alongside an event-driven system for state synchronization to pre
This is a C# game architecture framework for Unity rather than a TypeScript-native dependency injection library, making it the wrong language and domain for your requirements.
Ember.js is a structured JavaScript web framework designed for building scalable web applications. It utilizes a Model-View-Controller architectural pattern and incorporates a component-based UI library, a dependency injection framework, and a client-side routing engine. The framework distinguishes itself through a centralized registry for passing shared services across components and routes, alongside a routing system that maps URLs directly to templates and data models to manage navigation. Its broader capabilities include reactive state synchronization and computation memoization for UI p
Ember.js is a comprehensive full-stack web framework that includes a dependency injection system as an internal component, rather than a standalone TypeScript-native library for managing object lifecycles in arbitrary applications.
Rocket is a type-safe web framework designed for building server-side applications. It provides a high-performance asynchronous routing engine that maps incoming network traffic to concurrent handler functions, while managing the full lifecycle of web requests. The framework emphasizes compile-time verification, ensuring that request parameters, response types, and routing logic remain consistent throughout the development process. The framework distinguishes itself through its use of request guards, which act as a validation layer to intercept and transform incoming data into structured type
This is a web framework for Rust rather than a TypeScript-native dependency injection library, and its internal container is a specific implementation detail for managing request-scoped objects rather than a general-purpose DI tool.
| Repository | Stars | Language | License | Last push |
|---|---|---|---|---|
| inversify/inversifyjs | 12.1K | TypeScript | MIT | |
| typestack/typedi | 4.2K | TypeScript | MIT | |
| microsoft/tsyringe | 6K | TypeScript | MIT | |
| jeffijoe/awilix | 4.1K | TypeScript | mit | |
| midwayjs/midway | 7.7K | TypeScript | MIT | |
| nestjs/nest | 75.9K | TypeScript | MIT | |
| effect-ts/core | 14.6K | TypeScript | MIT | |
| santiq/bulletproof-nodejs | 5.8K | TypeScript | MIT | |
| prismlibrary/prism | 6.8K | C# | NOASSERTION | |
| liangxiegame/qframework | 5.2K | C# | mit |