Skip to content

Commit b37317f

Browse files
committed
Update README and documentation for bundle size and formatting improvements
1 parent bb0ff08 commit b37317f

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Modern, lightweight TypeScript Dependency Injection optimized for Bun runtime.
44

55
[![npm version](https://img.shields.io/npm/v/fast-injection)](https://www.npmjs.com/package/fast-injection)
6-
[![Bundle Size](https://img.shields.io/badge/bundle%20size-%3C5KB-brightgreen)](https://github.com/21no-de/fast-injection)
6+
[![Bundle Size](https://img.shields.io/badge/bundle%20size-%3C10KB-brightgreen)](https://github.com/21no-de/fast-injection)
77
[![TypeScript](https://img.shields.io/badge/TypeScript-5.0%2B-blue)](https://www.typescriptlang.org/)
88
[![Bun](https://img.shields.io/badge/Bun-1.0%2B-orange)](https://bun.sh)
99
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
@@ -13,7 +13,7 @@ Modern, lightweight TypeScript Dependency Injection optimized for Bun runtime.
1313
## Features
1414

1515
-**Blazing Fast**: Sub-microsecond dependency resolution
16-
- 🪶 **Lightweight**: < 5KB minified + gzipped
16+
- 🪶 **Lightweight**: < 10KB minified + gzipped
1717
- 🔒 **Type-Safe**: Full TypeScript support with inference
1818
- 🛡️ **Secure**: Protected against prototype pollution, memory leaks, ReDoS, and DoS attacks
1919
- 🎯 **Zero Dependencies**: No production dependencies
@@ -294,25 +294,27 @@ bun run bench
294294
Fast-Injection implements comprehensive security measures to protect against common vulnerabilities. See [SECURITY.md](SECURITY.md) for detailed information.
295295

296296
**Key Features:**
297+
297298
- 🛡️ **Prototype Pollution Prevention**: Token validation rejects dangerous property names
298299
- 🔄 **Async Promise Safety**: Failed resolutions tracked with TTL to prevent memory leaks
299300
- 🧹 **Memory Management**: Explicit cleanup utilities for dynamic classes
300301
-**ReDoS Prevention**: Removed unsafe regex patterns
301302

302303
**Quick Example:**
304+
303305
```typescript
304306
// ❌ Don't use reserved token names
305-
container.register('__proto__', MyService); // Throws RegistrationError
307+
container.register("__proto__", MyService); // Throws RegistrationError
306308

307309
// ✅ Use safe, descriptive tokens
308-
container.register('myService', MyService);
310+
container.register("myService", MyService);
309311

310312
// ✅ Clean up dynamic classes
311313
clearDecoratorMetadata(DynamicService);
312314

313315
// ✅ Always dispose containers when done
314316
await container.dispose();
315-
````
317+
```
316318

317319
For comprehensive security documentation, threat model, and best practices, see [SECURITY.md](SECURITY.md).
318320

0 commit comments

Comments
 (0)