Skip to content

Commit 10cadd7

Browse files
committed
feat: add multi context
1 parent d7c2d5e commit 10cadd7

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,17 @@
22

33
`node-simple-context` is an helper to create a context in node.
44

5+
This library is highly inspired by [nctx](https://github.com/devthejo/nctx). You definitely should check it out!
6+
57
## Installation
68

79
```sh
810
npm install --save node-simple-context
911
```
1012

11-
## Examples
13+
## Usage
1214

13-
### Simple
15+
### Simple example
1416

1517
#### 1. Create a new file `my-context.ts` in which you define your context.
1618

@@ -43,7 +45,7 @@ console.log(contextA.get('xxx')); // undefined
4345
console.log(contextA.get<string>('foo')); // bar
4446
```
4547

46-
### Complex
48+
### Complex examples
4749

4850
#### By forking your context
4951

@@ -94,8 +96,6 @@ const res = await Promise.all([
9496
console.log(res); // ['foo=tata', 'foo=toto', 'foo=titi', 'foo=tutu']
9597
```
9698

97-
:warning: I advice you to use [nctx](https://github.com/devthejo/nctx) to get a context which uses `parentExecutionId` if you want to get your property in an other promise.
98-
9999
#### By using multiple contexts
100100

101101
```ts

0 commit comments

Comments
 (0)