33## Installation
44
55``` bash
6- bun add fast-di
6+ bun add fast-injection
77```
88
99## Basic Usage
1010
1111### 1. Simple Service Registration
1212
1313``` typescript
14- import { Container } from " fast-di " ;
15- import { singleton } from " fast-di /decorators" ;
14+ import { Container } from " fast-injection " ;
15+ import { singleton } from " fast-injection /decorators" ;
1616
1717@singleton ()
1818class Logger {
@@ -25,14 +25,14 @@ const container = new Container();
2525container .register (Logger ); // Decorator controls lifetime
2626
2727const logger = container .resolve (Logger );
28- logger .log (" Hello, fast-di !" );
28+ logger .log (" Hello, fast-injection !" );
2929```
3030
3131### 2. Dependency Injection with Factories
3232
3333``` typescript
34- import { Container } from " fast-di " ;
35- import { singleton } from " fast-di /decorators" ;
34+ import { Container } from " fast-injection " ;
35+ import { singleton } from " fast-injection /decorators" ;
3636
3737@singleton ()
3838class Database {
@@ -68,8 +68,8 @@ console.log(service.getUsers());
6868### 3. Scoped Containers (for HTTP requests)
6969
7070``` typescript
71- import { Container } from " fast-di " ;
72- import { singleton , scoped , inject } from " fast-di /decorators" ;
71+ import { Container } from " fast-injection " ;
72+ import { singleton , scoped , inject } from " fast-injection /decorators" ;
7373
7474@singleton ()
7575class Database {
@@ -104,7 +104,7 @@ await requestScope.dispose();
104104Use ` getGlobalContainer() ` to access a shared container instance across your entire application without passing it around:
105105
106106``` typescript
107- import { getGlobalContainer , resetGlobalContainer , Lifetime } from " fast-di " ;
107+ import { getGlobalContainer , resetGlobalContainer , Lifetime } from " fast-injection " ;
108108
109109// Setup at application startup (e.g., in main.ts)
110110function setupContainer() {
@@ -175,7 +175,7 @@ await container.dispose(); // Calls onDispose on all services
175175### 7. Testing with Mocks
176176
177177``` typescript
178- import { createTestContainer } from " fast-di /testing" ;
178+ import { createTestContainer } from " fast-injection /testing" ;
179179
180180// In your tests
181181const container = createTestContainer ();
@@ -198,7 +198,7 @@ const service = container.resolve(UserService);
198198While decorators are the recommended default, explicit options are useful when:
199199
200200``` typescript
201- import { Lifetime } from " fast-di " ;
201+ import { Lifetime } from " fast-injection " ;
202202
203203// Override decorator at registration
204204@singleton ()
@@ -220,8 +220,8 @@ You can use decorators to control service lifetimes and document your code. **De
220220### 8. Decorator-Based Lifetimes
221221
222222``` typescript
223- import { Container } from " fast-di " ;
224- import { singleton , transient , scoped } from " fast-di /decorators" ;
223+ import { Container } from " fast-injection " ;
224+ import { singleton , transient , scoped } from " fast-injection /decorators" ;
225225
226226@singleton ()
227227class ConfigService {
@@ -267,7 +267,7 @@ console.log(logger1 === logger2); // false
267267### 8. Using @inject for Interface Tokens
268268
269269``` typescript
270- import { injectable , inject } from " fast-di /decorators" ;
270+ import { injectable , inject } from " fast-injection /decorators" ;
271271
272272const ILogger = Symbol (" ILogger" );
273273const IDatabase = Symbol (" IDatabase" );
@@ -325,7 +325,7 @@ await service.getUsers();
325325### 9. Decorators Control Lifetimes
326326
327327``` typescript
328- import { singleton } from " fast-di /decorators" ;
328+ import { singleton } from " fast-injection /decorators" ;
329329
330330@singleton ()
331331class Database {
@@ -412,7 +412,7 @@ const service = container.resolve(UserService);
412412}
413413```
414414
415- ### Decorator Methods (from "fast-di /decorators")
415+ ### Decorator Methods (from "fast-injection /decorators")
416416
417417- ` @injectable() ` - Mark class as injectable (transient lifetime)
418418- ` @singleton() ` - Mark class as singleton lifetime
@@ -495,7 +495,7 @@ container.registerFactory(UserService, (c) => {
495495});
496496
497497// Or, with decorators and @inject, no factory is needed:
498- import { singleton , inject } from " fast-di /decorators" ;
498+ import { singleton , inject } from " fast-injection /decorators" ;
499499
500500@singleton ()
501501class UserService {
@@ -588,4 +588,4 @@ container.registerFactory(ServiceA, (c) => {
588588
589589---
590590
591- ** fast-di ** - Built with ❤️ by [ 21no.de] ( https://21no.de ) | [ MIT License] ( LICENSE )
591+ ** fast-injection ** - Built with ❤️ by [ 21no.de] ( https://21no.de ) | [ MIT License] ( LICENSE )
0 commit comments