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

@stackra/contracts

v1.7.0

Published

Shared interfaces, types, enums, and DI tokens for the Stackra ecosystem. Zero runtime implementation.

Readme

@stackra/contracts

Zero-runtime vocabulary shared across every @stackra/* package — DI tokens, interfaces, types, enums, and event-name maps. If a symbol needs to be referenced by more than one runtime package, it lives here.

Why this exists. Cross-package consumers (metrics collectors, audit loggers, dashboards, testing helpers) subscribe to event names, inject tokens, and type-check against contract interfaces without pulling any runtime code. Every @stackra/* runtime package depends on contracts; nothing else depends on any runtime.

Install

pnpm add @stackra/contracts

Peer dependencies: none. contracts compiles to types-only output.

Layout

src/
  tokens/      # Symbol.for(…) DI tokens
  interfaces/  # interface declarations only
  types/       # standalone type aliases
  enums/       # enums (Scope, ShutdownSignal, LogLevel)
  events/      # event-constant maps + event-name unions

The rule is strict: enums live in enums/, interfaces live in interfaces/, standalone type aliases live in types/. Nothing mixes.

Public API

DI Tokens

Every token is a Symbol.for(…) so it survives module duplication and cross-realm inspection:

import {
  APPLICATION,
  APP_CONFIG,
  CACHE_MANAGER,
  CACHE_CONFIG,
  CACHE_STORE_METADATA_KEY,
  COLLABORATION_ROOM_MANAGER,
  COLLABORATION_CONFIG,
  COORDINATOR_CONFIG,
  TAB_COORDINATOR,
  DISCOVERY_SERVICE,
  EVENT_EMITTER,
  EVENT_EMITTER_CONFIG,
  LOGGER_MANAGER,
  LOGGER_CONFIG,
  QUEUE_MANAGER,
  QUEUE_CONFIG,
  PROCESSOR_METADATA_KEY,
  ON_JOB_EVENT_METADATA_KEY,
  REALTIME_MANAGER,
  REALTIME_CONFIG,
  SCHEDULER_SERVICE,
  SCHEDULER_CONFIG,
  TASK_RUNNER,
  SCHEDULED_METADATA_KEY,
} from "@stackra/contracts";

Event Name Constants

Every runtime package emits events on the shared EVENT_EMITTER bus using these constants:

import {
  CACHE_EVENTS, // cache.hit, cache.miss, cache.written, …
  COLLABORATION_EVENTS, // collaboration.cursor-move, collaboration.thread-create, …
  COORDINATOR_EVENTS, // coordinator.leader-elected, coordinator.tab-joined, …
  LOGGER_EVENTS, // logger.channel-registered, …
  QUEUE_EVENTS, // queue.job-queued, queue.job-completed, …
  REALTIME_EVENTS, // realtime.connected, realtime.message, …
  SCHEDULER_EVENTS, // scheduler.task-started, scheduler.task-failed, …
} from "@stackra/contracts";

// Union types for exhaustive listener maps
import type { CacheEventName, QueueEventName } from "@stackra/contracts";

DI Foundation Interfaces

The DI vocabulary consumed by @stackra/container and expressed as contract interfaces so any custom module can implement them:

import type {
  IApplication,
  IApplicationContext,
  IContainerResolver,
  IDiscoveryService,
  IDiscoveryProvider,
  IProviderWrapper,
  DynamicModule,
  ModuleMetadata,
  Provider,
  ClassProvider,
  ValueProvider,
  FactoryProvider,
  ExistingProvider,
  IAsyncModuleOptions,
  OnModuleInit,
  OnModuleDestroy,
  OnApplicationBootstrap,
  OnApplicationShutdown,
} from "@stackra/contracts";

Domain Interfaces

Cross-package contracts consumed by more than one runtime:

import type {
  IEventEmitter,
  IEventEmitterSync,
  ICacheStore,
  ICacheModuleConfig,
  ILoggerModuleConfig,
  IHookRegistrar,
} from "@stackra/contracts";

Types

import type {
  InjectionToken,
  Provider,
  OptionalFactoryDependency,
  LogContext,
} from "@stackra/contracts";

Enums

import {
  Scope,
  ShutdownSignal,
  LogLevel,
  LOG_LEVEL_PRIORITY,
} from "@stackra/contracts";

Versioning contract

  • Patch (0.1.x → 0.1.y) — additions to token/event/interface exports.
  • Minor (0.1.x → 0.2.0) — non-breaking additions or field additions to existing interfaces.
  • Major — removals, renames, or breaking type changes.

Every runtime package pins @stackra/contracts with ^ so they auto-adopt patch and minor bumps.

License

MIT