dynopromise-client
v0.2.0
Published
A client for dynamodb using promises.
Downloads
7
Maintainers
Readme
A client for DynamoDB using promises.
Install:
npm i dynopromise-client
Requires aws-sdk to be installed globally. This is not listed as a hard dependency, because it is already made available to Lambda functions when running in the Lambda environment, therefore does not actually need to be included in your package locally.
Usage:
const dynamodb = require('dynopromise-client')
const db = dynamodb({
accessKeyId: ...,
secretAccessKey: ...,
...,
})
db.put({
TableName: <dynamodb table name>,
Item: {
...
}
})
.then(() => <do something...>)
.catch(err => <handle error...>)
Options are passed through to the constructor specificed here: https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/DynamoDB.html#constructor-property
Promisified methods: batchGet, batchWrite, createSet, delete, get, put, query, scan, update