UNPKG

dynopromise-client

Version:

A client for dynamodb using promises.

38 lines (30 loc) 888 B
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