Skip to main content
NexusDI Logo

NexusDI

A modern, lightweight dependency injection library for TypeScript

Fast, type-safe, and developer-friendly. Built for clean, maintainable code.

import { Nexus, Service, Token } from '@nexusdi/core';

const USER_SERVICE = new Token('UserService');

@Service()
class UserService {
getUsers() {
return ['Alice', 'Bob', 'Charlie'];
}
}

const container = new Nexus();
container.set(USER_SERVICE, UserService);

const userService = container.get(USER_SERVICE);
console.log(userService.getUsers()); // ['Alice', 'Bob', 'Charlie']
Modern & Type-Safe

Modern & Type-Safe

Built from the ground up with TypeScript decorators to provide a fully type-safe and modern developer experience.

Powerful Module System

Powerful Module System

Organize your application into modules with support for both static and dynamic configuration, inspired by industry-leading frameworks.

Developer-Friendly API

Developer-Friendly API

Designed with a clean and intuitive API that makes it easy to manage dependencies and build scalable applications.