0.2.1 • Published 8 days ago

@driimus/aws-event-factory v0.2.1

Weekly downloads
-
License
MIT
Repository
github
Last release
8 days ago

@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

Type hints

For types to work as expected, @types/aws-lambda must be installed:

pnpm add --save-dev @types/aws-lambda

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

0.2.1

8 days ago

0.2.0

13 days ago

0.1.3

12 months ago

0.1.2

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago