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

@wiznetic-npm/kernel

v1.0.0

Published

Programmable lifecycle microkernel by Wiznetic

Readme

@wiznetic/kernel

Programmable lifecycle microkernel by Wiznetic.

A minimal, flexible kernel that provides a mechanism for modules to connect, communicate, and extend the system. The kernel has no opinion about HTTP, WebSocket, CLI, or any specific technology — those are module responsibilities.

Installation

npm install @wiznetic/kernel

Concepts

The kernel does three things:

  • Hooks — lifecycle points where modules can plug in (on / run)
  • Events — typed messages dispatched between modules (listen / dispatch)
  • Extension — the kernel itself can be extended or replaced (extend)

Everything else (HTTP server, WebSocket, Bootstrap chain, routing) is built on top as modules.

API

Kernel.on(hook, callback)

Register a callback on a named lifecycle hook.

import { Kernel } from '@wiznetic/kernel';

Kernel.on('start', async (ctx) => {
    console.log('system starting');
});

Kernel.run(hook, ctx?)

Execute all callbacks registered on a hook. Returns a Promise.

await Kernel.run('start');
await Kernel.run('request', { req, res });

Kernel.listen(EventClass, handler)

Register a handler for a specific event class.

import { Kernel } from '@wiznetic/kernel';
import { PathResolvedEvent } from './events/PathResolvedEvent.js';

Kernel.listen(PathResolvedEvent, async (event) => {
    console.log(event.path);
});

Kernel.dispatch(event)

Dispatch an event to all registered listeners. Returns a Promise resolving to the event.

const event = await Kernel.dispatch(new PathResolvedEvent('/var/www'));

Propagation can be stopped from within a handler:

Kernel.listen(PathResolvedEvent, async (event) => {
    event.stopPropagation(); // no further handlers will run
});

Kernel.extend(plugin)

Extend or replace parts of the kernel. The plugin receives the Kernel class directly.

Kernel.extend((kernel) => {
    const original = kernel.dispatch.bind(kernel);

    kernel.dispatch = async (event) => {
        console.log('dispatching', event.constructor.name);
        return original(event);
    };
});

Events

Extend the base Event class for typed events.

import { Event } from '@wiznetic/kernel';

export class PathResolvedEvent extends Event {
    constructor(path) {
        super();
        this.path = path;
    }
}

Example

import { Kernel, Event } from '@wiznetic/kernel';

class AppStartedEvent extends Event {
    constructor(config) {
        super();
        this.config = config;
    }
}

Kernel.listen(AppStartedEvent, async (event) => {
    console.log('App started with config:', event.config);
});

Kernel.on('start', async () => {
    await Kernel.dispatch(new AppStartedEvent({ port: 3000 }));
});

await Kernel.run('start');

Design

The kernel is intentionally minimal. It does not handle:

  • HTTP or WebSocket servers — use a module
  • Process management or uptime — use PM2 or Docker
  • Reconnection logic — handle in the client module
  • Bootstrap or dependency resolution — build on top via modules

The kernel is a base resource. Modules connect to it and own their problems.

License

MIT