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

@awsless/dynamodb-server

v0.1.3

Published

A local DynamoDB server for testing and development. Provides both a fast in-memory implementation and a Java-based implementation using the official AWS DynamoDB Local.

Readme

@awsless/dynamodb-server

A local DynamoDB server for testing and development. Provides both a fast in-memory implementation and a Java-based implementation using the official AWS DynamoDB Local.

Features

  • Fast In-Memory Engine - Lightning fast in-memory implementation for rapid testing
  • Java Engine - Full compatibility mode using the official AWS DynamoDB Local
  • DynamoDB Streams - Support for stream callbacks on item changes
  • TTL Support - Time-to-live expiration for items
  • GSI/LSI Support - Global and Local Secondary Index support

Setup

Install with (NPM):

npm i @awsless/dynamodb-server

Basic Usage

import { DynamoDBServer } from "@awsless/dynamodb-server"

// Create a server with the fast in-memory engine (default)
const server = new DynamoDBServer()

// Or use the Java engine for full compatibility
const server = new DynamoDBServer({ engine: "java" })

// Start the server
await server.listen(8000)

// Get a DynamoDB client configured to use the local server
const client = server.getClient()

// Get a DynamoDB Document client
const documentClient = server.getDocumentClient()

// Stop the server when done
await server.stop()

Engines

Memory Engine (Default)

The in-memory engine is optimized for speed and is perfect for unit tests. It implements the core DynamoDB operations without requiring Java.

const server = new DynamoDBServer({ engine: "memory" })

Java Engine

The Java engine uses AWS DynamoDB Local for full compatibility with DynamoDB behavior. Requires Java to be installed.

const server = new DynamoDBServer({ engine: "java" })

Configuration Options

const server = new DynamoDBServer({
  // Engine type: "memory" (default) or "java"
  engine: "memory",

  // Hostname to bind to (default: "localhost")
  hostname: "localhost",

  // Port to listen on (default: auto-assigned)
  port: 8000,

  // AWS region (default: "us-east-1")
  region: "us-east-1",
})

Stream Support

You can subscribe to item changes using stream callbacks:

const unsubscribe = server.onStreamRecord("my-table", record => {
  console.log("Stream event:", record.eventName) // INSERT, MODIFY, or REMOVE
  console.log("Keys:", record.dynamodb.Keys)
  console.log("New Image:", record.dynamodb.NewImage)
  console.log("Old Image:", record.dynamodb.OldImage)
})

// Unsubscribe when done
unsubscribe()

Testing with Vitest/Jest

import { DynamoDBServer } from "@awsless/dynamodb-server"
import { CreateTableCommand } from "@aws-sdk/client-dynamodb"
import { PutCommand, GetCommand } from "@aws-sdk/lib-dynamodb"

describe("My DynamoDB Tests", () => {
  const server = new DynamoDBServer()

  beforeAll(async () => {
    await server.listen()

    // Create your tables
    await server.getClient().send(
      new CreateTableCommand({
        TableName: "users",
        KeySchema: [{ AttributeName: "id", KeyType: "HASH" }],
        AttributeDefinitions: [{ AttributeName: "id", AttributeType: "N" }],
        BillingMode: "PAY_PER_REQUEST",
      })
    )
  })

  afterAll(async () => {
    await server.stop()
  })

  it("should store and retrieve items", async () => {
    const client = server.getDocumentClient()

    await client.send(
      new PutCommand({
        TableName: "users",
        Item: { id: 1, name: "John" },
      })
    )

    const result = await client.send(
      new GetCommand({
        TableName: "users",
        Key: { id: 1 },
      })
    )

    expect(result.Item).toEqual({ id: 1, name: "John" })
  })
})

License

MIT