JSPM

@kartikrao/sls-dynamodb-client

0.3.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2
  • Score
    100M100P100Q14211F
  • License MIT

Creates a local/production dynamodb client with options

Package Exports

  • @kartikrao/sls-dynamodb-client

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@kartikrao/sls-dynamodb-client) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

sls-dynamodb-client

serverless

A module to make dynamodb client creation environment agnostic.

  • Use the same DynamoDB client code for local development and on AWS Lambda.
  • Pass options to DynamoDB or DocumentClient
  • Use a custom endpoint for dynamodb-local

Dependencies

Installation

npm install --save sls-dynamodb-client

Usage

const ddb = require('sls-dynamodb-client')();

// Get a DocumentClient - AWS.DynamoDB.DocumentClient()
let docClient = ddb.getDocumentClient();

// Get the low level client - AWS.DynamoDB()
let dynamodb = ddb.getClient();

Custom local endpoint

const ddb = require('sls-dynamodb-client')("customregion", "http://customhost:customport/");

// DocumentClient requests will go to "customhost:customport"
let docClient = ddb.getDocumentClient();

// DynamoDB client requests will go to "customhost:customport"
let dynamodb = ddb.getClient();

Passing Options

const ddb = require('sls-dynamodb-client')("customregion", "http://customhost:customport/");
let options = {"convertEmptyValues": true};
let docClient = ddb.getDocumentClient(options);

References