Skip to content

ynevet/dynamodb-doc-client-wrapper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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: '[TIMEOUT]', maxRetries: '[MAX-RETRIES]'});


// Initialized as DynamoDB docuemnt client:
clientWrapper = new DocumentClientWrapper(
    ClientType.DynamoDB, ['ENDPOINT'], '[REGION]', { timeout: '[TIMEOUT]', maxRetries: '[MAX-RETRIES]'});

About

A wrapper around AWS DynamoDB document client (DynamoDB/DAX)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •