# resolve-storage-dynamo

> This package serves as an adapter for resolve-storage to store events using DynamoDB.

Latest version **0.20.25** (published 2019-08-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install resolve-storage-dynamo
pnpm add resolve-storage-dynamo
yarn add resolve-storage-dynamo
bun add resolve-storage-dynamo
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; pre 1.0.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 0.20.25 |
| Published | 2019-08-15 |
| First published | 2018-11-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Node | >=8.10 |
| Dependencies | 3 |
| Unpacked size | 180.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 772 |
| Author | reimagined team |
| Maintainers | reimagined |
| Keywords | cqrs, eventsourcing, es, ddd |

## Links

- npm: https://www.npmjs.com/package/resolve-storage-dynamo
- Repository: https://github.com/reimagined/resolve
- Homepage: https://github.com/reimagined/resolve/tree/master/packages/adapters/storage-adapters/resolve-storage-dynamo#readme
- Issues: https://github.com/reimagined/resolve/issues
- npm.io page: https://npm.io/package/resolve-storage-dynamo

## Dependencies (3)

- [@babel/runtime](https://npm.io/package/@babel/runtime.md) ^7.0.0
- [resolve-debug-levels](https://npm.io/package/resolve-debug-levels.md) 0.20.25
- [resolve-storage-base](https://npm.io/package/resolve-storage-base.md) 0.20.25

## Alternatives

- [duck](https://npm.io/package/duck.md) — 4.2M weekly downloads
- [ava](https://npm.io/package/ava.md) — 560.2K weekly downloads
- [storybook-addon-module-mock](https://npm.io/package/storybook-addon-module-mock.md) — 71.7K weekly downloads
- [vest](https://npm.io/package/vest.md) — 50.1K weekly downloads
- [@ethereum-waffle/mock-contract](https://npm.io/package/@ethereum-waffle/mock-contract.md) — 40.0K weekly downloads

## Recent versions

- 0.20.25 (latest) — 2019-08-15
- 0.20.24 — 2019-08-09
- 0.20.23 — 2019-08-07
- 0.20.22 — 2019-08-07
- 0.20.21 — 2019-07-26
- 0.20.20 — 2019-07-22
- 0.20.19 — 2019-07-15
- 0.20.18 — 2019-07-05
- 0.20.17 — 2019-06-28
- 0.20.16 — 2019-06-26
- 0.20.15 — 2019-06-24
- 0.20.14 — 2019-06-20
- 0.20.13 — 2019-06-19
- 0.20.12 — 2019-06-18
- 0.20.11 — 2019-06-03
- … 38 more at https://npm.io/package/resolve-storage-dynamo/versions

## README

# **resolve-storage-dynamo**
[![npm version](https://badge.fury.io/js/resolve-storage-dynamo.svg)](https://badge.fury.io/js/resolve-storage-dynamo)

This package is a `resolve-es` adapter for storing events using [DynamoDB](https://aws.amazon.com/dynamodb/).

## Available Parameters
* `...connectionOptions` - a DynamoDB connection options. Refer to [Connection Options Format](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/DynamoDB.html) for more information.
* `tableName` - a name of a table storing events.
* `billingMode` - billing mode for dynamodb table.
* `readCapacityUnits` - the maximum number of strongly consistent reads consumed per second.
* `writeCapacityUnits` - the maximum number of writes consumed per second.
## Usage

### [PROVISIONED] Billing Mode
```js
import createAdapter from 'resolve-storage-dynamo'

const connectionOptions = {
  region: 'localhost',
  endpoint: 'http://localhost:8000',
  accessKeyId: 'xxx',
  secretAccessKey: 'xxx',
}

const adapter = createAdapter({
  ...connectionOptions,
  tableName: 'MY_TABLE_NAME',
  billingMode: 'PROVISIONED',
  readCapacityUnits: 5,
  writeCapacityUnits: 5
})
```

### [PAY_PER_REQUEST] Billing Mode
```js
import createAdapter from 'resolve-storage-dynamo'

const connectionOptions = {
  region: 'localhost',
  endpoint: 'http://localhost:8000',
  accessKeyId: 'xxx',
  secretAccessKey: 'xxx',
}

const adapter = createAdapter({
  ...connectionOptions,
  tableName: 'MY_TABLE_NAME'
})
```


#### As Resource
```js
import { create, dispose, destroy, waitForCreate } from 'resolve-storage-dynamo'

const lazyResource = await create({ 
  region,
  tableName, 
  readCapacityUnits, 
  writeCapacityUnits 
})

await waitForCreate(lazyResource)

await dispose({ 
  region,
  tableName, 
  newTableName, 
  readCapacityUnits, 
  writeCapacityUnits 
})

await destroy({ 
  region,
  tableName, 
  readCapacityUnits, 
  writeCapacityUnits 
})
```

![Analytics](https://ga-beacon.appspot.com/UA-118635726-1/packages-resolve-storage-mongo-readme?pixel)

---
_Source: https://npm.io/package/resolve-storage-dynamo · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
