66** [ Diddly library] ( https://github.com/tom-sherman/diddly ) ** , who deserves most
77credit for this work.
88
9+ ## Install instructions
10+
11+ ### Node
12+
13+ ```
14+ # With NPM
15+ npm install @coderspirit/lambda-ioc
16+
17+ # Or with Yarn:
18+ yarn add @coderspirit/lambda-ioc
19+ ```
20+
21+ ### [ Deno] ( https://deno.land/ )
22+
23+ ` Lambda-IoC ` is served through different CDNs
24+ ``` typescript
25+ import { ... } from ' https://denopkg.com/Coder-Spirit/lambda-ioc@[VERSION]/lambda-ioc/deno/index.ts'
26+ import { ... } from ' https://deno.land/x/lambda_ioc@[VERSION]/lambda-ioc/deno/index.ts'
27+ ```
28+
929## Benefits
1030
1131- 100% type safe:
@@ -31,17 +51,17 @@ credit for this work.
3151## Example
3252
3353``` ts
34- import { createContainer } from ' @coderspirit/lambda-ioc' ;
54+ import { createContainer } from ' @coderspirit/lambda-ioc'
3555
3656function printNameAndAge(name : string , age : number ) {
37- console .log (` ${name } is aged ${age } ` );
57+ console .log (` ${name } is aged ${age } ` )
3858}
3959
4060const container = createContainer ()
4161 .register (' someAge' , value (5 ))
4262 .register (' someName' , value (' Timmy' ))
43- .register (' fn' , func (printNameAndAge , ' someName' , ' someAge' ));
63+ .register (' fn' , func (printNameAndAge , ' someName' , ' someAge' ))
4464
45- const print = container .resolve (' fn' );
46- print (); // Prints "Timmy is aged 5"
65+ const print = container .resolve (' fn' )
66+ print () // Prints "Timmy is aged 5"
4767```
0 commit comments