# lambda-responses

> Simple npm package for helping with lambda responses

Latest version **1.0.1** (published 2020-09-22) · ISC license · 0 weekly downloads

## Install

```sh
npm install lambda-responses
pnpm add lambda-responses
yarn add lambda-responses
bun add lambda-responses
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2020-09-22 |
| First published | 2020-09-22 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 5.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Corey Shaw |
| Maintainers | coreyshaw |
| Keywords | lambda, responses, lambda-responses, serverless |

## Links

- npm: https://www.npmjs.com/package/lambda-responses
- Repository: https://github.com/coreyshaw/lambda-responses
- Homepage: https://github.com/coreyshaw/lambda-responses#readme
- Issues: https://github.com/coreyshaw/lambda-responses/issues
- npm.io page: https://npm.io/package/lambda-responses

## Recent versions

- 1.0.1 (latest) — 2020-09-22
- 1.0.0 — 2020-09-22

## README

Lambda Responses
=======================================

[![Build Status](https://travis-ci.org/coreyshaw/lambda-responses.svg?branch=master)](https://travis-ci.org/coreyshaw/lambda-responses)

Simple library to help with lambda responses. 
* ***Note:*** This tool was build to be used internally but wanted to make it available to others if needed.
* ***Credit:*** https://github.com/AnomalyInnovations/serverless-stack-demo-api

### Success

Call the success function to return the 200 response.

```js
const { success } = require('../utils/responses');

return success({
  status: 'success',
  data: {
    message: 'This is a sample message',
  },
});
```

### Failure

Call the failure function to return the 500 response.

```js
const { failure } = require('../utils/responses');

return failure({
  status: 'failure',
  data: {
    message: 'This is a sample message',
  },
});
```

### Not Found

Call the notFound function to return the 500 response.

```js
const { notFound } = require('../utils/responses');

return notFound({
  status: 'notFound',
  data: {
    message: 'This is a sample message',
  },
});
```

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