Skip to content

Repository files navigation

@mshick/dyno

A simple DynamoDB client, inspired by dyno.

Install

pnpm add @mshick/dyno

Example

import { Dyno } from '@mshick/dyno';

const table = new Dyno({ table: 'my-table', region: 'us-east-1' });

await table.ensureTable({
  AttributeDefinitions: [{ AttributeName: 'id', AttributeType: 'S' }],
  KeySchema: [{ AttributeName: 'id', KeyType: 'HASH' }],
});

await table.batchPutAll([{ id: 'a' }, { id: 'b' }]).sendAll();

const { Items } = await table.scan({ Pages: Infinity });
console.log(Items); // [{id: 'a'}, {id: 'b'}]

For supported methods and more examples, see the Dyno tests.

Development

This project uses pnpm. Tests use a local DynamoDB via Docker (docker-compose.yml), so make sure Docker is running.

pnpm install
pnpm test          # spins up DynamoDB, runs vitest
pnpm check         # tsc --noEmit
pnpm lint          # biome check
pnpm build         # emits dist/

Release

Releases are driven by release-please on the main branch. PR titles and the first commit on a branch must follow Conventional Commits (e.g. feat: add new method, fix: handle empty batch). Subsequent commits on a branch can use plain descriptive messages.

License

MIT

About

A simple DynamoDB client.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages