https://github.com/kbrashears5/typescript-aws-dynamo-helper
Typescript AWS DynamoDB Helper
https://github.com/kbrashears5/typescript-aws-dynamo-helper
aws dynamo helper javascript lambda typescript
Last synced: 4 months ago
JSON representation
Typescript AWS DynamoDB Helper
- Host: GitHub
- URL: https://github.com/kbrashears5/typescript-aws-dynamo-helper
- Owner: kbrashears5
- License: mit
- Created: 2020-05-27T23:08:58.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2024-06-01T11:03:31.000Z (about 2 years ago)
- Last Synced: 2025-10-12T10:02:32.943Z (8 months ago)
- Topics: aws, dynamo, helper, javascript, lambda, typescript
- Language: TypeScript
- Homepage: https://github.com/kbrashears5/typescript-aws-dynamo-helper#readme
- Size: 78.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
typescript-aws-dynamo-helper
Typescript helper functions for AWS Dynamo DB service
[](https://github.com/kbrashears5/typescript-aws-dynamo-helper/actions/workflows/ci-cd.yml)
[](https://codecov.io/gh/kbrashears5/typescript-aws-dynamo-helper)
[](https://img.shields.io/npm/v/typescript-aws-dynamo-helper)
[](https://img.shields.io/npm/dt/typescript-aws-dynamo-helper)
## Install
```
npm install typescript-aws-dynamo-helper@latest
```
## Usage
### Default - running in Lambda in your own account
```typescript
const logger = new Logger(LogLevel.Trace);
const helper = new DynamoHelper(logger);
const response = await helper.GetItemByKeyAsync(
'tableName',
'keyName',
'keyValue',
);
```
### Running in separate account or not in Lambda
```typescript
import * as DynamoDB from '@aws-sdk/client-dynamodb';
const logger = new Logger(LogLevel.Trace);
const options: DynamoDB.DynamoDBClientConfig = {
accessKeyId: '{access_key}',
secretAccessKey: '{secret_key}',
region: 'us-east-1',
};
const repository = new DynamoDB.DynamoDB(options);
const helper = new DynamoHelper(logger, repository);
const response = await helper.GetItemByKeyAsync(
'tableName',
'keyName',
'keyValue',
);
```
## Notes
If no options are supplied, will default to `us-east-1` as the region
## Development
Clone the latest and run
```npm
npm run prep
```
to install packages and prep the git hooks