# @vissree_s/cfn-response-async

> A module for managing lambda-funciton backed custom resources in AWS CloudFormation with async support

Latest version **0.0.1** (published 2021-09-11) · SEE LICENCE IN LICENCE.md license · 0 weekly downloads

## Install

```sh
npm install @vissree_s/cfn-response-async
pnpm add @vissree_s/cfn-response-async
yarn add @vissree_s/cfn-response-async
bun add @vissree_s/cfn-response-async
```

## 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.1 |
| Published | 2021-09-11 |
| First published | 2021-09-11 |
| Weekly downloads | 0 |
| License | SEE LICENCE IN LICENCE.md |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 37.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | vissree |
| Maintainers | vissree_s |
| Keywords | aws, cfn-response-async, async, response, lambda, cloudFormation, custom, resource, cloud, formation |

## Links

- npm: https://www.npmjs.com/package/@vissree_s/cfn-response-async
- Repository: https://github.com/vissree/cfn-response-async
- Homepage: https://github.com/vissree/cfn-response-async#readme
- Issues: https://github.com/vissree/cfn-response-async/issues
- npm.io page: https://npm.io/package/@vissree_s/cfn-response-async

## 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

- 0.0.1 (latest) — 2021-09-11

## README

# README

This package is an async version of [cfn-response module](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-lambda-function-code-cfnresponsemodule.html#w2ab1c27c23c16b9c15).

The module includes a send method, which sends a [Custom resource response object](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/crpg-ref-responses.html) corresponding to the received [request object](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/crpg-ref-requests.html) and returns a promise, so that it can be used within [Async nodejs handlers](https://docs.aws.amazon.com/lambda/latest/dg/nodejs-handler.html#nodejs-handler-async).

## Sample usage

```javascript
const response = require("cfn-response-async");

async function someAsyncLogicToRun() {
  return "All good!";
}

exports.handler = async (event, context) => {
  console.log(event);
  console.log(context);

  var res;

  try {
    const outputValue = await someAsyncLogicToRun();
    const responseData = {
      Value: outputValue,
    };

    res = await response.send(event, context, response.SUCCESS, responseData);
  } catch (error) {
    console.log(error);
    res = await response.send(event, context, response.FAILED);
  }

  console.log("Status code: " + res.statusCode);
  console.log("Status message: " + res.statusMessagee);
  return res.statusCode;
};
```

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