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

@saibotsivad/dynamodb

v1.1.0

Published

Minimalist DynamoDB request generator.

Readme

@saibotsivad/dynamodb

Generate signed HTTP requests to AWS DynamoDB.

Install

The normal way:

npm install @saibotsivad/dynamodb

Overview

Instantiate with the normal AWS credentials and a fetch-like interface (see below for compatability notes), then call it to make requests:

import { dynamodb } from '@saibotsivad/dynamodb'

// Normal AWS IAM credentials:
const credentials = {
	region: 'us-east-1',
	secretAccessKey: 'hKVU_EXAMPLE_SECRET_5rjo',
	accessKeyId: 'AKIA_EXAMPLE_KEY'
}

// In a Worker environment (aka Cloudflare Workers) you can use the
// global fetch directly:
const db = dynamodb({ credentials, fetch: globalThis.fetch })

// But in the NodeJS environment, you'll need to use something like "httpie":
import { post } from 'httpie' // only POST is used
const fetch = async (url, options) => post(url, options)
const db = dynamodb({ credentials, fetch })

const response = await db('PutItem', {
	ReturnConsumedCapacity: 'TOTAL',
	TableName: 'Music',
	Item: {
		AlbumTitle: {
			S: 'Somewhat Famous'
		},
		Artist: {
			S: 'No One You Know'
		},
		SongTitle: {
			S: 'Call Me Today'
		}
	},
})
// response => { ConsumedCapacity: { CapacityUnits: 1, TableName: 'Music' } }

Error Handling

If the response is an error, for example if you try to PutItem on a table that doesn't exist, calling await db will throw an error named AwsException that contains the following properties:

  • name: String - Will always be AwsException.
  • method: String - This is simply the method name that you provided, e.g. PutItem.
  • params: Object - These are the parameters that were used, e.g. { TableName, Item }.
  • type: String - The long-form error code from AWS, e.g. com.amazonaws.dynamodb.v20120810#ResourceNotFoundException.
  • code: String - The short-form error code, e.g. ResourceNotFoundException.

API

Instantiate a database using the AWS credentials, and a fetch-like object:

import { dynamodb } from '@saibotsivad/dynamodb'
const db = dynamodb({
	credentials: {
		region: 'us-east-1',
		secretAccessKey: 'hKVU_EXAMPLE_SECRET_5rjo',
		accessKeyId: 'AKIA_EXAMPLE_KEY'
	},
	fetch: globalThis.fetch
})

The fetch function must have a signature like async (method: string, params: object) and return one of the following:

  • { json: async function } - The normal fetch does this.
  • { data: string | object } - If the data property is an object it'll get returned, or if it's a string it'll get JSON-parsed.
  • { body: string | object } - Same thing with the body property.

Methods

The DynamoDB API supports all valid DynamoDB service methods.

How to Read the Docs

To figure out what your request parameters and response object should look like, have a look at the AWS docs.

  • v2: For each link, there is a description of the service and an example of its use. For each service, after the example is a long, sometimes difficult to read, list of parameters and their meaning.
  • v3: For each link you'll find the same description and examples, but the request parameters are called "input" and the response is called "output". For example, on the BatchGetItem docs page, you'll find a link to BatchGetItemCommandInput and BatchGetItemCommandOutput which you'll need to click into to figure out the parameters of each.

License

Published and released under the VOL.