tiny-di.js 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -7
- package/package.json +1 -4
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#
|
|
1
|
+
# tiny-di.js
|
|
2
2
|
|
|
3
3
|
A lightweight, type-safe **Dependency Injection** container for TypeScript and Node.js. Define your dependencies programmatically with full type inference — no decorators required.
|
|
4
4
|
|
|
@@ -15,17 +15,17 @@ A lightweight, type-safe **Dependency Injection** container for TypeScript and N
|
|
|
15
15
|
## Installation
|
|
16
16
|
|
|
17
17
|
```sh
|
|
18
|
-
npm install
|
|
18
|
+
npm install tiny-di.js
|
|
19
19
|
# or
|
|
20
|
-
pnpm add
|
|
20
|
+
pnpm add tiny-di.js
|
|
21
21
|
# or
|
|
22
|
-
yarn add
|
|
22
|
+
yarn add tiny-di.js
|
|
23
23
|
```
|
|
24
24
|
|
|
25
25
|
## Quick Start
|
|
26
26
|
|
|
27
27
|
```typescript
|
|
28
|
-
import { Container } from "
|
|
28
|
+
import { Container } from "tiny-di.js";
|
|
29
29
|
|
|
30
30
|
class Logger {
|
|
31
31
|
log(msg: string) {
|
|
@@ -105,8 +105,8 @@ const c = scope2.get(MyScopedService);
|
|
|
105
105
|
|
|
106
106
|
```typescript
|
|
107
107
|
import express, { Request } from "express";
|
|
108
|
-
import { Container, Scope } from "
|
|
109
|
-
import { scopedMiddleware, ScopedRequest } from "
|
|
108
|
+
import { Container, Scope } from "tiny-di.js";
|
|
109
|
+
import { scopedMiddleware, ScopedRequest } from "tiny-di.js/express";
|
|
110
110
|
|
|
111
111
|
const container = new Container();
|
|
112
112
|
container.scoped(AUTH_CTX).none();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tiny-di.js",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Lightweight dependency injection container",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -27,8 +27,5 @@
|
|
|
27
27
|
"supertest": "^7.2.2",
|
|
28
28
|
"typescript": "^6.0.3",
|
|
29
29
|
"vitest": "^4.1.8"
|
|
30
|
-
},
|
|
31
|
-
"dependencies": {
|
|
32
|
-
"reflect-metadata": "^0.2.2"
|
|
33
30
|
}
|
|
34
31
|
}
|