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

serverless-dynamodb-seeder

v0.1.0

Published

Serverless plugin focused on seeding DynamoDB tables (LocalStack friendly)

Readme

serverless-dynamodb-seeder

A lightweight Serverless Framework plugin that focuses exclusively on seeding DynamoDB tables. It is built to work seamlessly with serverless-localstack, custom endpoints (e.g. LocalStack edge, AWS endpoints, localhost), and regular AWS accounts.

Requirements

  • Node.js 22 or newer
  • Serverless Framework v3+

Installation

npm install --save-dev serverless-dynamodb-seeder

serverless.yml:

plugins:
  - serverless-dynamodb-seeder

Configuration

Declare the tables you want to seed in custom.dynamodb.seed. Categories let you group seed files so that you can run subsets from the CLI. If you set custom.dynamodb.start.migrate: true (or pass --migrate to the seed command) the plugin will create any missing tables based on your CloudFormation resources before it starts writing data.

custom:
  # Optional stage allow-list. When omitted, seeding runs in every stage.
  dynamodb:
    stages:
      - local
      - test

    # Optional global defaults. You can also pass these via CLI flags.
    region: us-east-1
    convertEmptyValues: true

    # Local start helpers (used by "serverless offline")
    start:
      migrate: true   # create missing tables before seeding
      seed: true      # run the seeder automatically on offline start

    # Seed definitions grouped by category
    seed:
      demo:
        sources:
          - table: Users
            sources:
              - seeds/users.json
          - table: RawUsers
            rawsources:
              - seeds/raw-users.json
      smoke:
        sources:
          - table: Subscriptions
            sources:
              - seeds/subscriptions.json

Each entry supports:

  • table (required) – DynamoDB table name.
  • sources – JSON files containing plain JavaScript objects (DocumentClient format).
  • rawsources – JSON files using the low-level AttributeValue format.

Paths are resolved relative to your Serverless service directory.

LocalStack integration

When custom.localstack is present the plugin automatically reuses its endpoint information. Fallback order:

  1. CLI --endpoint
  2. custom.dynamodb.endpoint
  3. custom.localstack.endpoints.dynamodb (or DynamoDB)
  4. custom.localstack.host + edgePort
  5. Environment variables (DYNAMODB_SEED_ENDPOINT, DYNAMODB_ENDPOINT, LOCALSTACK_HOST*)
  6. http://localhost:4566

This makes it compatible with serverless-localstack without additional configuration.

Usage

sls dynamodb seed

CLI options:

  • --seed / -s – Comma-separated list of categories to execute.
  • --migrate – Create DynamoDB tables before seeding (defaults to custom.dynamodb.start.migrate).
  • --endpoint / -e – Override the DynamoDB endpoint.
  • --region / -r – Override the region used when creating the client.
  • --convertEmptyValues – Enable DocumentClient empty value conversion.

Example:

sls dynamodb seed --seed=demo --endpoint=http://localhost:4566

When you run sls offline start, the plugin reads custom.dynamodb.start to decide whether to create tables (start.migrate) and/or seed data (start.seed).

Seed file examples

seeds/users.json

[
  {
    "id": "1",
    "name": "Alice",
    "tags": ["local"]
  }
]

seeds/raw-users.json

[
  {
    "id": { "S": "1" },
    "score": { "N": "10" }
  }
]

Testing

npm test

The test suite stubs the AWS SDK so it runs without a local DynamoDB process.

npm run lint

Run ESLint to keep the codebase consistent.

License

MIT