# @kartikrao/sls-dynamodb-client

> Creates a local/production dynamodb client with options

Latest version **0.3.0** (published 2018-06-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install @kartikrao/sls-dynamodb-client
pnpm add @kartikrao/sls-dynamodb-client
yarn add @kartikrao/sls-dynamodb-client
bun add @kartikrao/sls-dynamodb-client
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.0 |
| Published | 2018-06-26 |
| First published | 2018-06-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 7.7 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Kartik Rao |
| Maintainers | kartikrao |
| Keywords | serverless, dynamodb, serverless-offline, dynamodb-local |

## Links

- npm: https://www.npmjs.com/package/@kartikrao/sls-dynamodb-client
- Repository: https://github.com/kartikrao/sls-dynamodb-client
- Homepage: https://github.com/kartikrao/sls-dynamodb-client#readme
- Issues: https://github.com/kartikrao/sls-dynamodb-client/issues
- npm.io page: https://npm.io/package/@kartikrao/sls-dynamodb-client

## Dependencies (1)

- [aws-sdk](https://npm.io/package/aws-sdk.md) ^2.263.1

## Recent versions

- 0.3.0 (latest) — 2018-06-26
- 0.2.2 — 2018-06-26
- 0.2.1 — 2018-06-26
- 0.2.0 — 2018-06-26

## README

sls-dynamodb-client
=================================

[![serverless](http://public.serverless.com/badges/v3.svg)](http://www.serverless.com)

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

*  [serverless-offline](https://github.com/dherault/serverless-offline) - Required to detect offline/online status
*  [serverless-dynamodb-local](https://github.com/99xt/serverless-dynamodb-local) - Required to run dynamodb locally during development

## 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
* [Dynamodb Documentation](http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/DynamoDB.html)

---
_Source: https://npm.io/package/@kartikrao/sls-dynamodb-client · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
