SkillAgentSearch skills...

Redi

💉 A dependency injection library for TypeScript & JavaScript, along with a binding for React.

Install / Use

/learn @wzhudev/Redi
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

redi

<p className="flex h-6"> <img alt="stars" src="https://badgen.net/github/stars/wzhudev/redi" style={{ display: "inline-block", marginRight: "0.5rem" }} /> <img alt="downloads" src="https://badgen.net/npm/dw/@wendellhu/redi" style={{ display: "inline-block", marginRight: "0.5rem" }} /> <img alt="license" src="https://badgen.net/github/license/wzhudev/redi" style={{ display: "inline-block", marginRight: "0.5rem" }} /> <img alt="coverage" src="https://img.shields.io/codecov/c/github/wzhudev/redi.svg" style={{ display: "inline-block" }} /> </p>

redi (pronounced 'ready') is a lightweight dependency injection library for TypeScript and JavaScript, with React bindings included.

Why redi?

| Feature | Description | | ----------------------- | ----------------------------------------------- | | ðŸŠķ Lightweight | Zero dependencies, small bundle size | | 🔧 esbuild friendly | No emitDecoratorMetadata required | | ðŸ“Ķ Feature-rich | Class, value, factory, async injection and more | | ⚛ïļ React ready | Built-in hooks for React integration | | ✅ Well tested | 100% code coverage |

Quick Start

npm install @wendellhu/redi
import { Inject, Injector } from '@wendellhu/redi';

class AuthService {
  getCurrentUserInfo(): UserInfo {
    /* ... */
  }
}

class FileListService {
  constructor(@Inject(AuthService) private authService: AuthService) {}

  getUserFiles(): Promise<Files> {
    const user = this.authService.getCurrentUserInfo();
    // ...
  }
}

const injector = new Injector([[AuthService], [FileListService]]);
const fileList = injector.get(FileListService);

Getting started.

Features

Who's Using redi?

Links

License

MIT. Copyright 2021-present Wenzhao Hu.

View on GitHub
GitHub Stars161
CategoryDevelopment
Updated2d ago
Forks20

Languages

TypeScript

Security Score

100/100

Audited on Mar 30, 2026

No findings