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

@mikara89/cap-storage-mikro-orm

v2.2.0

Published

MikroORM storage adapter for CAP

Readme

@mikara89/cap-storage-mikro-orm

MikroORM storage adapter for CAP.

This package provides durable outbox and inbox persistence through:

  • CapPublishEntity
  • CapReceivedEntity
  • MikroPublishStorage
  • MikroReceivedStorage
  • MikroStorageModule from the explicit Nest subpath

Usage Shape

import { MikroOrmModule } from '@mikro-orm/nestjs';
import {
  CapPublishEntity,
  CapReceivedEntity,
} from '@mikara89/cap-storage-mikro-orm';
import { MikroStorageModule } from '@mikara89/cap-storage-mikro-orm/nest';

@Module({
  imports: [
    MikroOrmModule.forRoot({
      dbName: process.env.DB_NAME,
      entities: [CapPublishEntity, CapReceivedEntity],
    }),
    MikroStorageModule,
    transportModule,
  ],
})
export class AppModule {}

Notes

  • The package root is framework-neutral. Use /nest exports only when wiring the optional Nest module, and install the Nest peers for that usage.

  • Manage production schemas through migrations or infrastructure tooling.

  • Production outbox dispatch requires a MikroORM SQL driver that supports pessimistic partial write locking; use a custom storage adapter if your database cannot provide equivalent claim safety.

  • The first-party multi-instance DB gate covers PostgreSQL and MySQL.

  • SQLite/local demo drivers and SQL Server fall back to non-locking transactional claims and are not supported for multi-instance durable dispatch by this adapter.

  • MikroPublishStorage and MikroReceivedStorage implement CapabilityAwareStoragePort. PostgreSQL and MySQL report safe skip-locked claiming; SQLite, SQL Server, and unknown/local drivers report conservative non-locking claiming capability.

  • MikroORM transaction-aware publish can use the operation context API:

    await cap.publish('user.created', payload, {
      ctx: { tx: em },
    });

    The old top-level tx style still works:

    await cap.publish('user.created', payload, {
      tx: em,
    });

    When tx or ctx.tx is provided, CAP saves the outbox row inside that transaction and defers broker emit by default. The scheduler dispatches after commit.

  • savePublishWithTx remains as deprecated compatibility. Prefer savePublish(event, { tx }) in storage integrations.

  • Inbox idempotency uses unique (group, dedupeKey) records. Existing databases upgrading from message-id dedupe need a migration that adds inbox status, lastError, and processedAt columns and replaces the old unique index.

  • Dashboard list/find helpers are included for outbox and inbox records.

Documentation