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

@victorylabs/core

v0.2.0

Published

Plugin runtime for the @victorylabs/* framework — zero dependencies, zero React types

Readme

@victorylabs/core

Plugin runtime for the @victorylabs/* framework. Zero runtime dependencies, zero React types, framework-agnostic.

@victorylabs/core is the foundation every @victorylabs/* package depends on. It provides the Core orchestrator, Plugin base class, typed PluginToken identity, facets for multi-contributor cross-cutting concerns, a typed EventEmitter, observable state, and a composable middleware primitive.

Install

pnpm add @victorylabs/core

Quick start

import { Core, Plugin, createPluginToken, createObservable } from '@victorylabs/core'

const CounterToken = createPluginToken<CounterPlugin>('CounterPlugin')

class CounterPlugin extends Plugin {
  readonly key = CounterToken
  readonly count = createObservable(0)

  increment(): void {
    this.count.set(this.count.get() + 1)
  }
}

const core = new Core()
core.register(new CounterPlugin())
await core.bootstrap()

const counter = core.get(CounterToken)
counter.increment()

Key exports

  • Core — top-level orchestrator. register(plugin), bootstrap(), get(token), on(event, listener), healthCheck(), snapshot(), shutdown().
  • Plugin — abstract base class. Override prepare(ctx) and start(ctx); declare key, dependencies, optional includes, destroy(), healthCheck().
  • createPluginToken<T>(name) — typed identity for core.get(...) resolution.
  • createObservable<T>(initial) — push-based reactive state with get(), set(), subscribe().
  • computed(deps, fn) — derived observable that recomputes when any dep changes.
  • createFacetToken<T>(name) / Facet<T> — multi-contributor channels (e.g. middleware arrays, React providers). Contributed to via ctx.facet(Token).contribute(source, values, Prec.default).
  • Prec — precedence tiers for facet contributions (highest, high, default, low, lowest).
  • EventEmitter / narrowEmitter<T>() — typed pub/sub. Plugins declare events via module augmentation of PluginEventRegistry.
  • onBefore / onAfter / onError — middleware composition helpers.
  • PluginError — wraps plugin failures with { pluginKey, phase, cause }.

Lifecycle

Every plugin participates in a two-phase bootstrap:

  1. prepare(ctx) — set up state, contribute to facets, subscribe to events. Runs in dependency order.
  2. start(ctx) — read owned facets, go live. Runs after every plugin has prepared.

Failure in either phase calls destroy() on every plugin that already ran (reverse order) and puts Core into a permanent failed state.

See also