Skip to content
This repository was archived by the owner on Apr 21, 2024. It is now read-only.

Commit 7b48bdf

Browse files
committed
docs: document installation
1 parent 228172b commit 7b48bdf

File tree

2 files changed

+50
-10
lines changed

2 files changed

+50
-10
lines changed

README.md

+25-5
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,26 @@
66
**[Diddly library](https://github.com/tom-sherman/diddly)**, who deserves most
77
credit 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

3656
function printNameAndAge(name: string, age: number) {
37-
console.log(`${name} is aged ${age}`);
57+
console.log(`${name} is aged ${age}`)
3858
}
3959
4060
const 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
```

lambda-ioc/README.md

+25-5
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,26 @@
66
**[Diddly library](https://github.com/tom-sherman/diddly)**, who deserves most
77
credit 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

3656
function printNameAndAge(name: string, age: number) {
37-
console.log(`${name} is aged ${age}`);
57+
console.log(`${name} is aged ${age}`)
3858
}
3959
4060
const 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

Comments
 (0)