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

@fgiova/mini-dynamo-mapper

v1.0.0

Published

A type-safe DynamoDB mapper for Node.js built on top of [@fgiova/mini-dynamo-client](https://github.com/fgiova/mini-dynamo-client).

Downloads

212

Readme

@fgiova/mini-dynamo-mapper

A type-safe DynamoDB mapper for Node.js built on top of @fgiova/mini-dynamo-client.

NPM version CI workflow TypeScript Linted with Biome Maintainability Code Coverage

Define your table schema once and get full TypeScript inference for all operations: CRUD, queries, scans, batch, and transactions.

Installation

npm install @fgiova/mini-dynamo-mapper @fgiova/mini-dynamo-client

Requires Node.js ^22.14.0 || >= 24.10.0

Quick Start

import { MiniDynamoClient } from "@fgiova/mini-dynamo-client";
import {
  defineModel,
  DataMapper,
  equals,
  set,
  updateExpression,
} from "@fgiova/mini-dynamo-mapper";

// 1. Define your model
const UserModel = defineModel({
  tableName: "Users",
  schema: {
    pk: { type: "String", keyType: "HASH" },
    sk: { type: "String", keyType: "RANGE" },
    name: { type: "String" },
    age: { type: "Number" },
    version: { type: "Number", versionAttribute: true },
  },
  indexes: {
    byAge: { type: "global", hashKey: "age" },
  },
});

// 2. Create the mapper
const client = new MiniDynamoClient({ region: "eu-west-1" });
const mapper = new DataMapper({ client });

// 3. Put an item
const user = await mapper.put(UserModel, {
  pk: "USER#1",
  sk: "PROFILE",
  name: "Alice",
  age: 30,
  version: 0,
});

// 4. Get an item
const result = await mapper.get(UserModel, { pk: "USER#1", sk: "PROFILE" });

// 5. Update an item
const updated = await mapper.update(
  UserModel,
  { pk: "USER#1", sk: "PROFILE" },
  updateExpression(set("name", "Bob"), set("age", 31))
);

// 6. Query items
for await (const item of mapper.query(UserModel, equals("pk", "USER#1"))) {
  console.log(item.name);
}

// 7. Delete an item
await mapper.delete(UserModel, { pk: "USER#1", sk: "PROFILE" });

Features

  • Type-safe schema - Define your schema once, get full TypeScript inference on all operations
  • Optimistic locking - Built-in version attribute support with automatic condition checks
  • Expression builders - Fluent API for conditions, updates, and projections
  • Async iterators - Paginated query/scan results via for await...of
  • Batch operations - Batch get/put/delete with automatic retry and exponential backoff
  • Transactions - Transactional read and write across multiple tables
  • Parallel scan - Multi-segment scan for large tables
  • Attribute mapping - Custom DynamoDB attribute names via attributeName
  • Custom types - User-defined marshall/unmarshall functions
  • Dual format - ESM and CommonJS support

Documentation

Detailed documentation is available per functional module:

| Module | Description | |--------|-------------| | Model & Schema | Define tables, schemas, indexes, and type inference | | DataMapper | CRUD operations: put, get, update, delete | | Expressions | Condition, update, and projection expression builders | | Iterators | Query, Scan, and ParallelScan with async iteration | | Batch & Transactions | Batch get/put/delete and transactional operations | | Marshaller | Data serialization between JS objects and DynamoDB format | | Types | Schema type system and TypeScript type inference |

License

MIT - Francesco Giovannini