# moromi-aws-lambda

> aws lambda plugin for moromi

Latest version **0.0.2** (published 2020-11-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install moromi-aws-lambda
pnpm add moromi-aws-lambda
yarn add moromi-aws-lambda
bun add moromi-aws-lambda
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2020-11-27 |
| First published | 2020-11-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 1.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Adriaan Pelzer |
| Maintainers | 4dr144n |

## Links

- npm: https://www.npmjs.com/package/moromi-aws-lambda
- Repository: https://github.com/adriaan-pelzer/moromi-aws-lambda
- Homepage: https://github.com/adriaan-pelzer/moromi-aws-lambda#readme
- Issues: https://github.com/adriaan-pelzer/moromi-aws-lambda/issues
- npm.io page: https://npm.io/package/moromi-aws-lambda

## Recent versions

- 0.0.2 (latest) — 2020-11-27
- 0.0.1 — 2020-11-27

## README

# moromi-aws-lambda
aws lambda plugin for moromi

## Installation
```
  yarn add moromi-aws-lambda
```

## Usage

### params:
* module: _the local filename of the lambda module to test (relative to the folder where moromi is being called from)_
* handler (default `handler`): _the handler name exported by the lambda module_
* event (default `{}`): _the event that the handler should be called with_
* context (default `null`): _the context that the handler should be called with_

## Example
Given the following lambda function:
```js
module.exports.handler = ({ Records: [{ cf: { request: {
  uri, method = 'GET', querystring = '', headers
} } }] }, context, callback) => callback(null, {
  uri,
  method,
  headers
});
```

the following moromi test will pass:
```js
{
  name: 'example aws lambda test',
  type: require('moromi-aws-lambda')
  params: {
    module: '../index.js',
    event: {
      Records: [{ cf: { request: {
        uri: '/test',
        headers: {
          host: [{ key: 'Host', value: 'example.is' }]
        }
      } } }]
    }
  },
  expected: {
    uri: '/test', method: 'GET',
   'headers.host.0.value': 'example.is'
  }
}
```

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