2.1.0 • Published 3 years ago

node-aws-utils v2.1.0

Weekly downloads
14
License
MIT
Repository
github
Last release
3 years ago

node-aws-utils

install dependencies

yarn install
# or
npm install

build

yarn run build
# or
npm run build

Dynamo

get item

import {DynamoDB} from "aws-sdk";
import {DynamoDocumentClient} from "node-aws-utils";

(async () => {
    const tableName = 'store';
    const where = {id: 1};
    const dynamo = new DynamoDB.DocumentClient();
    const storeData = (await DynamoDocumentClient.get(dynamo, tableName, where)).unwrap();
    console.log(storeData);
    // object or null
})();

put or update item

import {DynamoDB} from "aws-sdk";
import {DynamoDocumentClient} from "node-aws-utils";

(async () => {
    const tableName = 'store';
    const where = {id: 1};
    const data = {email: 'user@store.com'};
    const dynamo = new DynamoDB.DocumentClient();
    const updatedData = (await DynamoDocumentClient.update(dynamo, tableName, where, data)).unwrap();
    console.log(updatedData);
    // object or empty object
})();
2.1.0

3 years ago

2.0.1

3 years ago

1.7.0

3 years ago

2.0.0

3 years ago

1.6.0

3 years ago

1.5.0

3 years ago

1.4.0

3 years ago

1.3.0

3 years ago

1.2.0

3 years ago

1.1.0

3 years ago

1.0.0

3 years ago