# inversify-lambda-utils

> Inversify support for AWS lambda functions

Latest version **1.0.3** (published 2021-08-11) · ISC license · 0 weekly downloads

## Install

```sh
npm install inversify-lambda-utils
pnpm add inversify-lambda-utils
yarn add inversify-lambda-utils
bun add inversify-lambda-utils
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2021-08-11 |
| First published | 2021-08-11 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 25.7 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 1 |
| Author | BobCui20 |
| Maintainers | bobcui20 |
| Keywords | AWS, Inversify, Lambda |

## Links

- npm: https://www.npmjs.com/package/inversify-lambda-utils
- Repository: https://github.com/BobCui20/inversify-lambda-utils
- Issues: https://github.com/BobCui20/inversify-lambda-utils/issues
- npm.io page: https://npm.io/package/inversify-lambda-utils

## Dependencies (3)

- [uuid](https://npm.io/package/uuid.md) ^8.3.2
- [inversify](https://npm.io/package/inversify.md) ^5.1.1
- [reflect-metadata](https://npm.io/package/reflect-metadata.md) ^0.1.13

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 1.0.3 (latest) — 2021-08-11
- 1.0.1 — 2021-08-11

## README

# Inversify Lambda Utils
To provide IoC & DI for Lambda Applications.

## Usage

### Create a Lambda Function Collection

```typescript
@lambda()
export class GetUserLambda extends BaseLambda {

    @handler('TestHandler')
    async handle(context: ILambdaContext<SomeBodyType>): Promise<ApiGatewayResponse> {
        return {
            statusCode: 200,
            body: JSON.stringify({ Hello: 'World' }),
            headers: {}
        };
    }

}
```

### Generate the Lambda Handlers

`(index.ts)`
```typescript
// You have to import reflect-metadata as first import statement
import 'reflect-metadata';
// Remember to import the lambda class once to get it registered in the Reflect
import { GetUserLambda } from './get-user-lambda';
// ... some other imports

container = new Container();

const lambdaManager = new LambdaManager(container);

export = lambdaManager.build();
```

To Run Your Lambda Locally: `tsc && lambda-local -l dist/index.js -h TestHandler -e sample-events/empty.json`

---
_Source: https://npm.io/package/inversify-lambda-utils · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
