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

aws-dynamodb-query

v1.0.3

Published

A simple and elegant DynamoDB client for Node.js

Readme

aws-dynamodb-query

A simple and elegant DynamoDB client for Node.js.

license npm downloads

npm install aws-dynamodb-query

Features

  • AWS SDK v3 — Built on @aws-sdk/client-dynamodb and @aws-sdk/lib-dynamodb
  • Fluent API — Chainable query builder that reads like English
  • Async/Await — Every operation returns a Promise
  • ESM native — Modern ES modules, Node 18+

Quick Start

import DynamoDB from 'aws-dynamodb-query';

// With credentials
const db = new DynamoDB({
	accessKeyId: 'XXXXXXXXXX',
	secretAccessKey: 'XXXXXXXXXX',
	region: 'us-east-1',
});

// With IAM role (Lambda, EC2, ECS)
const db = new DynamoDB();

Usage

// Get
const user = await db.table('users').where('id').eq('123').get();

// Query with index
const orders = await db.table('orders').index('index-customer_id').where('customer_id').eq('cus_123').filter('status').eq('active').limit(10).descending().query();

// Scan
const all = await db.table('users').scan();

// Insert (fails if key exists)
await db.table('users').insert({ id: '123', name: 'Alice' });

// Update
await db.table('users').where('id').eq('123').update({ name: 'Bob' });

// Upsert
await db.table('users').insert_or_update({ id: '123', login_count: db.add(1) });

// Delete
await db.table('users').where('id').eq('123').delete();

Pagination

let lastKey = null;
do {
	const result = await db.table('users').resume(lastKey).limit(100).query();

	console.log(result.items);
	lastKey = result.lastKey;
} while (lastKey);

Operators

| Method | Operator | | --------------------------- | ------------------------ | | .eq(value) | = | | .ne(value) | <> | | .lt(value) / .le(value) | < / <= | | .gt(value) / .ge(value) | > / >= | | .between(a, b) | BETWEEN | | .begins_with(value) | begins_with() | | .contains(value) | contains() | | .not_contains(value) | NOT contains() | | .in([values]) | IN (...) | | .not_null() | attribute_exists() | | .null() | attribute_not_exists() |

Type Helpers

db.add(5); // Increment number
db.del(db.SS(['a'])); // Remove from set
db.S('hello'); // String
db.SS(['a', 'b']); // String Set
db.N(42); // Number
db.NS([1, 2, 3]); // Number Set
db.L([1, 'a']); // List

Schema Pre-registration

Avoid describeTable API calls:

db.schema([
	{
		TableName: 'users',
		KeySchema: [{ AttributeName: 'id', KeyType: 'HASH' }],
	},
]);

Configuration

DynamoDB.config({
	stringset_parse_as_set: true,
	numberset_parse_as_set: true,
	empty_string_replace_as: '\0',
});

Documentation

Credits

Based on the original work of @awspilot/dynamodb.

License

MIT