npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

dynamo-record

v1.9.0

Published

dynamo-record provides a DynamoDB client that adds Promise support and functionality beyond what is provided by the aws-sdk.

Readme

Dynamo Record

This package aims to provide a “humanized" and more readable support of DynamoDB DocumentClient.

Getting started

Installation

$ npm install dynamo-record --save

OR

$ yarn add dynamo-record

Import & initialization

// assumes AWS.config is set up already
import { DynamoRecord } from "dynamo-record";

const repo = new DynamoRecord<DataType, WhereType>(tableName, config, tracing);
  • tableName string the table name
  • config Dynamo Client Configuration The AWS DynamoDB configuration object
  • tracing optional - boolean enable or disable AWS X-Ray tracing feature. Default is false.

Key concept

The library generates the DynamoDB config for you.

In some cases where a method will not allow you to accomplish what you would like, each method has an optional params config where you can override each DocumentClient basic params. API documentation specify which basic method from DocumentClient is extended.

In Dynamo Record, all params for config are camelize (fooBar) key instead of pascalize (FooBar).

API

The following methods are available. All DocumentClient methods are not already implemented

find

Return a single element based on his primary key

repo.find(primaryKey, config);

Extend: get()

Parameters

  • primaryKey object with hash and range key. Provided keys must match dynamoDB schema.
  • config optional - object with DocumentClient params.

where

Return all items that match primary key and/or condition

repo.where(primaryKey, filterExpression, config);

Extend: query() scan()

Parameters

  • primaryKey optional - object with hash and range key. Provided keys must match dynamoDB schema.
  • filterExpression optional - object with required condition and keys property.
  • config optional - object with DocumentClient params.

getAll

Return all items

repo.getAll(config);

Extend: scan()

Parameters

  • config optional - object with DocumentClient params.

create

Add a new item

repo.create(createData, config);

Extend: put()

Parameters

  • createData object with data to add into table.
  • config optional - object with DocumentClient params.

batchCreate

Add an array of items

repo.batchCreate(createData, config);

Extend: batchWrite()

Parameters

  • createData array of items to add into table.
  • config optional - object with DocumentClient params.

update

Update an item based on his primary key

repo.update(primaryKey, updateData, config);

Extend: update()

Parameters

  • primaryKey object with hash and range key. Provided keys must match dynamoDB schema.
  • updateData object with item data to update.
  • config optional - object with DocumentClient params.

deepUpdate

Only update object endpoint values based on his primary key

The updated object must have a full existing tree of all nested object before the update. DynamoDB can't update a property and create it's parent object on the same request.

If user wants to update a whole object without knowing the nested content, he can pass a custom config through updateExpression, expressionAttributeNames and expressionAttributeValues.

repo.deepUpdate(primaryKey, updateData, config);

Extend: update()

Parameters

  • primaryKey object with hash and range key. Provided keys must match dynamoDB schema.
  • updateData object with item data to update.
  • config optional - object with DocumentClient params.

destroy

Remove an item

repo.delete(primaryKey, config);

Extend: delete()

Parameters

  • primaryKey object with hash and range key. Provided keys must match dynamoDB schema.
  • config optional - object with DocumentClient params.