@kartikrao/sls-dynamodb-client
    TypeScript icon, indicating that this package has built-in type declarations

    0.3.0 • Public • Published

    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

    Install

    npm i @kartikrao/sls-dynamodb-client

    DownloadsWeekly Downloads

    4

    Version

    0.3.0

    License

    MIT

    Unpacked Size

    7.88 kB

    Total Files

    9

    Last publish

    Collaborators

    • tarun-venkatesha
    • mksudharshan
    • varun.dogra
    • _kartikrao