@gomomento-poc/aws-cache-helpers
TypeScript icon, indicating that this package has built-in type declarations

0.2.3 • Public • Published

aws-cache-helpers

Various collection of JS utilities to help you enable caching with Momento in AWS.

image

Usage

AWS JS SDK v3 Middleware

import {NewCachingMiddleware} from '@gomomento-poc/aws-cache-helpers';

const authToken = 'REPLACE_ME';
const db = DynamoDBDocumentClient.from(new DynamoDBClient({}));
db.middlewareStack.use(NewCachingMiddleware({
    tableName: 'my-ddb-table',
    momentoAuthToken: authToken,
    defaultCacheTtl: 86400,
    cacheName: 'default'
  }
));

AWS DynamoDB Stream Lambda Handler

import {NewStreamCacheHandler} from '@gomomento-poc/aws-cache-helpers';

const authToken = 'REPLACE_ME';
export const handler = NewStreamCacheHandler({
  tableName: 'my-ddb-table',
  momentoAuthToken: authToken,
  defaultCacheTtl: 86400,
  cacheName: 'default' 
});

/@gomomento-poc/aws-cache-helpers/

    Package Sidebar

    Install

    npm i @gomomento-poc/aws-cache-helpers

    Weekly Downloads

    2

    Version

    0.2.3

    License

    Apache-2.0

    Unpacked Size

    41.7 kB

    Total Files

    12

    Last publish

    Collaborators

    • gomomento-poc