Socket
Socket
Sign inDemoInstall

@lifeomic/dynamodb-dataloader

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lifeomic/dynamodb-dataloader - npm Package Compare versions

Comparing version 0.0.5 to 1.0.0

2

package.json
{
"name": "@lifeomic/dynamodb-dataloader",
"version": "0.0.5",
"version": "1.0.0",
"description": "A DataLoader that batches DynamoDB item lookups",

@@ -5,0 +5,0 @@ "repository": {

@@ -1,3 +0,2 @@

dynamodb-dataloader
===================
# dynamodb-dataloader

@@ -8,2 +7,26 @@ [![npm](https://img.shields.io/npm/v/@lifeomic/dynamodb-dataloader.svg)](https://www.npmjs.com/package/@lifeomic/dynamodb-dataloader)

A DataLoader that batches requests for DynamoDB
A DataLoader that batches requests for DynamoDB. The DataLoader can fetch items
from multiple tables at once so you should only need one instance per request.
You should be able to replace your calls to `dynamoClient.get` with
`loader.load` and automaticly switch your network calls from `GetItem` to
`BatchGetItem`.
NOTE: Make sure you update your IAM policy to allow `dynamodb:BatchGetItem` if
you have strict IAM policies
# Example code
```javascript
const { createDataLoader } = require('@lifeomic/dynamodb-dataloader');
// Once per request or scope that can share data access
const client = new AWS.DyanmoDB();
const loader = createDataLoader({ client });
// Once per item fetch
const item = await loader.load({
table: 'your table name',
key: { idAattribute: { S: 'some id' } }
});
```
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc