v4.3.1 Released

Type-Safe Dependency Injection for Modern TypeScript

Lightweight, modular, zero-overhead dependency injection container & microservices ecosystem built for TypeScript monorepos, Bun, Node.js, and Cloudflare Workers.

$ bun x @di-framework/cli init
Documentation GitHub Repository
app.container.ts
import { Container, Injectable } from '@di-framework/core'; import { Controller, Get } from '@di-framework/http'; @Injectable() class UserService { getUser(id: string) { return { id, email: 'user@example.com', role: 'admin' }; } } @Controller('/users') class UserController { constructor(private userService: UserService) {} @Get('/:id') findOne(req: Request) { return this.userService.getUser(req.params.id); } } // Zero-overhead initialization & resolution const container = new Container(); container.register([UserService, UserController]);

Everything you need to build microservices

Modular design allows you to import only what you need — from HTTP routing to WebCrypto socket security.

Core DI Container

Singleton & transient scope resolution, decorator-based lifecycle management, and compile-time type safety.

HTTP & OpenAPI

Declarative HTTP controllers, parameter assertions, and automatic OpenAPI 3.0 schema generation.

Auto GraphQL

Generates GraphQL schemas automatically from decorated TypeScript domain objects and resolver classes.

Event Messaging

Bridge container events seamlessly across Kafka, NATS, or in-memory message buses with @Subscriber().

Auth & WebAuthn

Integrated JWT sessions, OAuth2/OIDC provider engine, and WebAuthn passkey assertions out of the box.

WebCrypto Sockets

Encrypted WebSocket, TCP, and UDP transport channels using ECDH & AES-GCM WebCrypto protocols.

Ecosystem Packages

14 specialized packages designed to work seamlessly together or independently.