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

@objectstack/core

v9.9.1

Published

Microkernel Core for ObjectStack

Readme

@objectstack/core

ObjectStack microkernel — dependency injection, plugin lifecycle, event bus, and service registry for metadata-driven runtimes.

npm License: Apache-2.0

Overview

@objectstack/core is the foundation every ObjectStack runtime is built on. It hosts two kernels, a plugin lifecycle, a typed service registry, a structured logger, and a plugin-to-plugin event bus:

  • ObjectKernel — full-featured production kernel with hot reload, health monitoring, dependency resolution, and namespace isolation.
  • LiteKernel — minimal kernel for serverless, edge, and test environments.

All other ObjectStack runtime packages (runtime, rest, plugin-*, driver-*, service-*) plug into a kernel instance.

Installation

pnpm add @objectstack/core

Quick Start

import { ObjectKernel } from '@objectstack/core';

const kernel = new ObjectKernel();

kernel.use({
  name: 'my-plugin',
  version: '1.0.0',
  async init(ctx) {
    ctx.logger.info('plugin initializing…');
    ctx.registerService('greeter', { hello: (n: string) => `hi ${n}` });
  },
  async start(ctx) {
    const svc = ctx.getService<{ hello: (s: string) => string }>('greeter')!;
    ctx.logger.info(svc.hello('world'));
  },
});

await kernel.bootstrap();
// …
await kernel.shutdown();

LiteKernel (serverless/edge/tests)

import { LiteKernel } from '@objectstack/core';

const kernel = new LiteKernel();
await kernel.bootstrap();

Key Exports

| Export | Kind | Description | |:---|:---|:---| | ObjectKernel | class | Production kernel with DI, lifecycle, event bus, hot reload, health monitor. | | LiteKernel | class | Minimal kernel for constrained runtimes. | | Plugin | interface | Plugin contract (init, start, stop, lifecycle hooks). | | PluginContext | interface | { logger, registerService, getService, eventBus, kernel }. | | ObjectLogger | class | Structured logger over pino; swappable backends. | | ApiRegistry | class | Runtime route registry (consumed by @objectstack/rest). | | QA | namespace | Built-in kernel self-tests. | | PackageManager | class | Per-package DI namespace resolver. |

Plugin lifecycle

use()  → init()  → start()  → [running]  → stop()  → unload()
  • init(ctx) — register services, wire dependencies. Do not make network calls.
  • start(ctx) — resolve other services, begin work. Called after every plugin's init().
  • stop(ctx) — graceful shutdown, flush, close connections.
  • kernel.unload(name) — runtime removal; pairs with AppPlugin.onDisable().

Kernel choice

| Kernel | Use when | |:---|:---| | ObjectKernel | Default. Production servers, Studio, tests that need plugin composition. | | LiteKernel | Cloudflare Workers, Vercel Edge, Vitest unit tests, footprint-sensitive sandboxes. |

EnhancedObjectKernel has been removed. Migrate to ObjectKernel.

Observability

  • ObjectLogger is backed by pino; control verbosity with LOG_LEVEL=info|debug|trace.
  • kernel.getHealth() returns per-plugin health snapshots.
  • EventBus: ctx.eventBus.on('plugin.started', …), .emit(…).

When to use

  • ✅ Building an ObjectStack application (always).
  • ✅ Authoring a plugin, driver, or service.

When not to use

Related Packages

Links

License

Apache-2.0. See LICENSING.md.