aws-dynamodb-doc-client-wrapper
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

aws-dynamodb-doc-client-wrapper

Description

A wrapper class around AWS DynamoDB document client that allows initializing & swapping between AWS DynamoDB to AWS DAX client easily

Motivation

Easily initialization of DynamoDB Document Client in a case when only one of the clients is available for use instead of long if-else code block just for initialization

Installation:

# using npm
npm install aws-dynamodb-doc-client-wrapper -s
# using yarn
yarn add aws-dynamodb-doc-client-wrapper

Usage example:

import { DocumentClientWrapper, ClientType } from "aws-dynamodb-doc-client-wrapper";
import { DocumentClient } from "aws-sdk/lib/dynamodb/document_client";

// Initialized as DAX docuemnt client:
clientWrapper = new DocumentClientWrapper(ClientType.DynamoDBDax, ['ENDPOINT'], '[REGION]', '[TIMEOUT]');


// Initialized as DynamoDB docuemnt client:
clientWrapper = new DocumentClientWrapper(ClientType.DynamoDB, ['ENDPOINT'], '[REGION]', '[TIMEOUT]');

Package Sidebar

Install

npm i aws-dynamodb-doc-client-wrapper

Weekly Downloads

0

Version

1.0.3

License

ISC

Unpacked Size

6.76 kB

Total Files

6

Last publish

Collaborators

  • ynevet