@lamware/do-not-wait
TypeScript icon, indicating that this package has built-in type declarations

2.0.1 • Public • Published
NPM Discord Apache-2.0

Lamware - Do Not Wait

This Lamware Middleware implements a Lambda best-practice of making sure Lambda doesn't wait for the event loop to be empty prior to responding by ensuring the callbackWaitsForEmptyEventLoop context variable is set to false.

Installation

This package is available via NPM:

yarn add @lamware/do-not-wait

# or

npm install @lamware/do-not-wait

Usage

import type { APIGatewayProxyHandlerV2 } from 'aws-lambda';
import { doNotWait } from '@lamware/do-not-wait';
import { lamware } from '@lamware/core';

const { handler } = lamware<APIGatewayProxyHandlerV2<any>>()
  .use(doNotWait())
  .execute(async () => {
    return { statusCode: 200 };
  });

export { handler };

Package Sidebar

Install

npm i @lamware/do-not-wait

Weekly Downloads

65

Version

2.0.1

License

GPL-3.0-only

Unpacked Size

38.6 kB

Total Files

7

Last publish

Collaborators

  • oyed