# @growsari/response

> For generating standard API and microservice responses

Latest version **0.0.3** (published 2020-07-08) · ISC license · 0 weekly downloads

## Install

```sh
npm install @growsari/response
pnpm add @growsari/response
yarn add @growsari/response
bun add @growsari/response
```

## 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.3 |
| Published | 2020-07-08 |
| First published | 2019-12-10 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 2 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Maintainers | ddimaano.gs, gs.dwight.badua, leland.growsari, madhugogineni, melyo, prasad.riktam |

## Links

- npm: https://www.npmjs.com/package/@growsari/response
- npm.io page: https://npm.io/package/@growsari/response

## Dependencies (1)

- [uuid](https://npm.io/package/uuid.md) ^3.3.3

## Recent versions

- 0.0.3 (latest) — 2020-07-08
- 0.0.2 — 2020-01-16
- 0.0.1 — 2019-12-10

## README

# Response

Convenience functions. Use in conjunction with `errors`; attributes retrieved from `errors` will show up in the response.

# Usage

## API Gateway responses

```
const { api } = require('@growsari/response')

async function serverlessHandler(event, ...) {
  try {
    // implementation
    api.success(await someFunction())
  } catch (e) {
    api.error(e)
  }
}
```

## Lambda microservice response

```
const { microservice } = require('@growsari/response')

async function serverlessHandler(event, ...) {
  try {
    // implementation
    microservice.success(await someFunction())
  } catch (e) {
    microservice.error(e)
  }
}
```

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