@driimus/aws-event-factory
TypeScript icon, indicating that this package has built-in type declarations

0.2.0 • Public • Published

@driimus/aws-event-factory

npm

Test data factories for different AWS Lambda event sources. Built using fishery.

Supported Lambda event sources

Goals

This package prioritizes structural integrity over veracity. While some of the generated data is truthful, explicit inputs should always be provided for the parts of an event that you really care about.

Installation

[!WARNING] This is an ES only package. Before installing, make sure that your project's configuration supports ECMAScript modules.

pnpm add --save-dev @faker-js/faker fishery @driimus/aws-event-factory

Usage

Make sure to check out fishery's documentation for a more detailed API Reference of the exposed factories.

import {
  dynamodbEventFactory,
  dynamodbRecordFactory,
  sqsEventFactory,
} from '@driimus/aws-event-factory';

const sqsEvent = sqsEventFactory.build(); // { Records: [...] }

const ddbEvent = dynamodbEventFactory.build({
  Records: [
    dynamodbRecordFactory.insert().build(), // { eventName: 'INSERT', ...}
    dynamodbRecordFactory.modify().build(), // { eventName: 'MODIFY', ...}
    dynamodbRecordFactory.remove().build(), // { eventName: 'REMOVE', ...}
  ],
}); // { Records: [...] }

More examples:

Prior art

Package Sidebar

Install

npm i @driimus/aws-event-factory

Weekly Downloads

63

Version

0.2.0

License

MIT

Unpacked Size

79.3 kB

Total Files

95

Last publish

Collaborators

  • driimus