# serverless-flow-plugin

> A lightweight testing framework for the Serverless Framework.

Latest version **0.0.9** (published 2016-11-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install serverless-flow-plugin
pnpm add serverless-flow-plugin
yarn add serverless-flow-plugin
bun add serverless-flow-plugin
```

## 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.9 |
| Published | 2016-11-14 |
| First published | 2016-10-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=4.0 |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | ac360 |

## Links

- npm: https://www.npmjs.com/package/serverless-flow-plugin
- npm.io page: https://npm.io/package/serverless-flow-plugin

## Dependencies (1)

- [chokidar](https://npm.io/package/chokidar.md) ^1.6.0

## Recent versions

- 0.0.9 (latest) — 2016-11-14
- 0.0.8 — 2016-11-13
- 0.0.7 — 2016-11-07
- 0.0.6 — 2016-11-03
- 0.0.5 — 2016-11-03
- 0.0.4 — 2016-10-20
- 0.0.3 — 2016-10-19
- 0.0.2 — 2016-10-19
- 0.0.1 — 2016-10-19
- 0.0.0 — 2016-10-19

## README

# Serverless-Flow

A lightweight testing framework for the Serverless Framework.

## Features

* Write mock events and invoke your functions with them while you write code.
* On save, this plugin automatically invokes your Function w/ each mock event and prints results in your console.
* Features a `local` or `remote` mode.  `remote` mode will quickly deploy your function before invoking it with mock data.
* Write multiple mock events for each event for your functions.

## Quick-Start

Install with npm:

```
npm i serverless-flow-plugin --save
```

Add it to your Serverless Service plugins:

```
plugins
  - serverless-flow-plugin
```

Add a mock property to your Functions:

```yml
# serverless.yml

functions
  hello
    handler: index.hello
    events:
      - http:
          path: hello
          method: get
          mocks: ${file(./mocks.yml):hello} # References to another file which contains the mocks
```

Create a `mocks.yml` file in your service folder:

```yml
# mocks.yml

hello_http: # Contains the mock for the "hello" function and "http" event
  succcess: # A mock for this function event
    query:
      clientId: aslkfjasf8kajsf981
  fail: # Another mock for this function event
    query:
      clientId: false
```

Start the plugin:

```
sls flow --function hello
```

Write code, hit save, and your function will be auto-invoked for each mock.

When you're done working locally, switch the `mode` to `remote` to test your mocks against live Lambdas

```
sls flow --function hello --mode remote // Remote mode invokes the function on Lambda
```

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