Neurotic and Probably Misinformed

    @distinction-dev/dynamo-unmarshall
    TypeScript icon, indicating that this package has built-in type declarations

    1.0.2 • Public • Published

    Middy DynamoDB Unmarshall

    Middy logo

    Dynamo DB Stream event data parser for the middy framework, like json body parser but for dynamodb stream events

    Simply uses AWS sdk's DynamoDB Document Client Converter to convert the data received in the New/Old Image of all records to plain json.

    Why?

    Taking inspiration from Json Body Parser, we decided to export this simple middleware we built

    Install

    To install this middleware you can use NPM:

    npm install --save @distinction-dev/dynamo-unmarshall

    Sample usage

    const middy = require('@middy/core');
    const dynamoUnmarshall = require('@middy/error-logger');
    
    const handler = middy((event, context) => {
      // your handler logic
    })
    
    handler
      .use(dynamoUnmarshall())

    Options

    • aws property: The instance of the aws-sdk, If none is provided then it will simply import it.

    • imageTypes property: An array providing which image types to convert can only contain "NewImage", "OldImage".

    • converterOptions property: The options that you wanna pass to the DynamoDB converter.

    License

    Licensed under MIT License.

    Install

    npm i @distinction-dev/dynamo-unmarshall

    DownloadsWeekly Downloads

    1

    Version

    1.0.2

    License

    MIT

    Unpacked Size

    8.54 kB

    Total Files

    8

    Last publish

    Collaborators

    • killdozerx2