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

@devsylar/dynamo-table

v1.0.0

Published

A lightweight utility library for interacting with AWS DynamoDB tables using common CRUD methods.

Downloads

77

Readme

@devsylar/dynamo-table

A lightweight utility library for interacting with AWS DynamoDB tables. Wraps the AWS SDK v3 to provide simple, readable methods for the most common CRUD operations on a single table.

Features

  • get — Retrieve a single item by primary key
  • query — Query items by key conditions (supports GSI)
  • scan — Scan and filter items across the entire table (supports GSI)
  • put — Create or replace an item
  • update — Update specific attributes of an existing item
  • Automatic handling of DynamoDB reserved word escaping via # prefix

Requirements

  • Node.js >= 14
  • AWS SDK v3 (@aws-sdk/client-dynamodb, @aws-sdk/util-dynamodb) — listed as peer dependencies

Installation

npm install @devsylar/dynamo-table

Install peer dependencies if not already present in your project:

npm install @aws-sdk/client-dynamodb @aws-sdk/util-dynamodb

Configuration

The client reads credentials and region from environment variables:

| Variable | Description | | ----------------------- | ----------------------------- | | AWS_REGION | AWS region (e.g. us-east-1) | | AWS_ACCESS_KEY_ID | AWS access key ID | | AWS_SECRET_ACCESS_KEY | AWS secret access key |

Usage

const DynamoDBTable = require("@devsylar/dynamo-table");

const usersTable = new DynamoDBTable("Users");

get(where)

Retrieves a single item by primary key. Returns null if not found.

const user = await usersTable.get({ userId: "123" });
// { userId: '123', name: 'Alice', status: 'ACTIVE' } or null

query(where, indexName?)

Queries items using key conditions. Pass an index name to query a GSI.

// Query by partition key
const orders = await ordersTable.query({ customerId: "c-001" });

// Query a GSI — use # prefix for reserved words
const active = await usersTable.query({ "#status": "ACTIVE" }, "status-index");

scan(where, indexName?, limit?)

Scans the table and filters by the given conditions. Prefer query() for large tables.

// Simple scan with filter
const pending = await ordersTable.scan({ "#status": "PENDING" });

// Scan a GSI with a limit
const recent = await ordersTable.scan({ type: "ORDER" }, "type-index", 50);

ConsistentRead is enabled by default on scans.

put(data)

Creates or replaces an item. If an item with the same key already exists, it will be overwritten.

await usersTable.put({
  userId: "456",
  name: "Bob",
  status: "ACTIVE",
  createdAt: new Date().toISOString(),
});

update(where, data)

Updates specific attributes of an existing item. Attributes not listed in data are left unchanged.

await usersTable.update(
  { userId: "456" },
  { "#status": "INACTIVE", updatedAt: new Date().toISOString() },
);

Handling Reserved Words

DynamoDB reserves certain attribute names (status, name, type, etc.). Prefix any reserved word key with # and the library will automatically build the correct ExpressionAttributeNames mapping for you.

// 'status' is a reserved word — use '#status'
await table.query({ "#status": "ACTIVE" }, "status-index");
await table.update({ id: "1" }, { "#status": "INACTIVE", "#name": "Alice" });

Project Structure

dynamo-table/
├── src/
│   └── dynamodbtable-lib.js   # Core library implementation
├── index.js                   # Package entry point
├── package.json
└── README.md

License

MIT