Skip to content

Instantly share code, notes, and snippets.

@thomasmichaelwallace
Created March 27, 2019 20:45
Show Gist options
  • Save thomasmichaelwallace/7618f82d87cbd84d8bcbe25790f3b1c5 to your computer and use it in GitHub Desktop.
Save thomasmichaelwallace/7618f82d87cbd84d8bcbe25790f3b1c5 to your computer and use it in GitHub Desktop.
aws-sdk benchmark: direct
import DynamoDB from 'aws-sdk/clients/dynamodb';
const ddb = new DynamoDB.DocumentClient({ region: 'eu-west-1' });
export async function handleV2(event) { // eslint-disable-line import/prefer-default-export
const { TableName, Key } = event;
const { Item } = await ddb.get({ TableName, Key }).promise();
return Item || {};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment