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

@nebulae/tpiv2-event-store

v0.0.3

Published

Reactive domain-event publishing and consumption for TPI V2 over NATS JetStream.

Readme

Full documentation: docs/00-README.md — envelope contract, the two env-var families, the consumer, why OutboxHandler is not a transactional outbox, and why NATS replaced Kafka.

@nebulae/tpiv2-event-store

Librería CommonJS de Nebula Engineering para eventos de dominio de TPI V2. Usa NATS JetStream para transporte y MongoDB 8 para outbox, dead-letter y reproceso.

Instalación

npm install @nebulae/tpiv2-event-store

Configuración

Variables principales:

| Variable | Propósito | Valor por defecto | | --- | --- | --- | | EVENTSTORE_ENABLED | Habilita productor y consumidor | true | | EVENTSTORE_SERVERS | Servidores NATS separados por coma | nats://localhost:4222 | | EVENTSTORE_CLIENT_ID | Identificador del cliente | definido por el µService | | EVENTSTORE_STREAM_NAME | Stream de JetStream | TPIV2_EVENTS | | EVENTSTORE_SUBJECT_PREFIX | Prefijo de subjects | evt | | EVENTSTORE_DURABLE_NAME | Identidad durable del consumidor | EVENTSTORE_CLIENT_ID | | EVENTSTORE_ENSURE_TOPICS_MODE | create, verify o skip | create | | EVENT_STORE_MONGODB_URL | URI de MongoDB; activa outbox y dead-letter | desactivado | | EVENT_STORE_MONGODB_DATABASE | Base de datos operacional | event-store | | EVENT_STORE_OUTBOX_CONTAINER | Coleccion de outbox | outbox | | EVENT_STORE_DEAD_LETTER_CONTAINER | Coleccion dead-letter | dead-letters |

En GKE, el stream y sus políticas deben aprovisionarse por IaC. Las credenciales se suministran mediante Kubernetes Secret sincronizado con Secret Manager.

Uso

const { EventStore, Event } = require("@nebulae/tpiv2-event-store");

const store = new EventStore({
  clientId: "organization-mng",
  groupId: "organization-mng",
  prod: { mse: "organization", mbe: "organization-mng" },
});

store.emit$(new Event({
  eventType: "OrganizationUpdated",
  aggregateType: "Organization",
  aggregateId: "org-1",
  organizationId: "nebulae",
  data: { name: "Nebula Engineering" },
}));

store.configAggregateEventMap({
  Organization: {
    OrganizationUpdated: { autoAck: false },
  },
});

aggregateVersion is always derived from timestamp as Unix epoch seconds. Callers cannot override it with a database revision.

Las claves de aggregate del mapa se instalan como filtros JetStream del durable (evt.Organization.*). El servicio no recibe aggregates que no declaró. Esta topología no usa particiones: hay un stream ordenado y un solo mensaje pendiente de ack por durable. El envelope no incluye claves de partición del broker.

La API conserva productor/consumidor reactivos, circuit breaker, reintentos, mapeo de subjects, outbox, dead-letter y reproceso. Consulte test/ para ejemplos ejecutables y playground/ para el entorno local con MongoDB 8 y NATS JetStream.

Publicación

GitLab CI valida y publica el paquete público en npmjs mediante trusted publishing con OIDC. El nombre del paquete es @nebulae/tpiv2-event-store.

Propiedad

  • Empresa: Nebula Engineering
  • Proyecto: TPI (Transporte Publico Individual) V2

Licencia

MIT. Consulte LICENSE. El aviso de copyright y la licencia deben conservarse en las copias o porciones sustanciales del software.