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

@devyuha/jkernel

v1.0.1

Published

A kernel for web to handle scripting

Downloads

25

Readme

Web Kernel

Web Kernel is an experimental runtime layer inspired by the core concepts of operating system kernels. While it is not a real kernel, it is designed to feel like one, focusing on structure, control and clarity without relying on shiny frameworks.

The idea originated while I am studying how OS kernels manage processes, states and system coordination.

As applications grow, scripting often becomes duplicated, tightly coupled, and hard to reason about. Web kernel explores whether a central control layer can manage programs, events and requests in a structured and predictable manner, while keeping the system minimal and extensible.

Philosophy

  • Structure programs, events, and requests without relying on frameworks.
  • Enable scripting using Javascript/Typescript.
  • Reduce duplication in execution and orchestration logic.
  • Follow lifecycle-based design for programs and requests.

What web kernel is (and isn't)

What it is

  • A runtime coordination layer.
  • A structured way to manage programs.
  • A state-aware execution controller.
  • A foundation for custom architecture.

What it is not

  • A web framework.
  • A replacement for React, Vue, Express, etc.
  • A dependency-heavy abstraction layer.
  • A magic solution for bad architecture.

Quickstart

To install web kernel, either install through npm or directly incldue the script.

Install through npm :

npm install @devyuha/jkernel

To initialize the kernel :

import { Kernel } from "@devyuha/jkernel";

// Initialize the kernel
window.kernel = new Kernel();

// Run programs on boot
window.kernel.onBoot((k) => {
    k.start("program-name");
});

// Run boot() method to boot the kernel
document.addEventListener("DOMContentLoaded", () => {
    window.kernel.boot();
});

Programs

Programs are first-class execution units, similar to processes in an OS.

Each Program :

  • Has a defined lifecycle.
  • Can be executed, tracked and observed.
  • Exists independently of framework logic.

To create and initialize programs :

export default class MyProgram {
    onStart(args) {
        console.log("My Program is started :: ", args);
    }

    onDestroy() {
        console.log("My Program is destroyed");
    }
}
// Register programs by passing program object and a name.
window.kernel.registerPrograms({
    "program-name": MyProgram
});

Run programs from kernel :

// Run program using kernel
// Arguments can be passed in start() method.
// Arguments are optional
window.kernel.start("program-name", {})

Run programs on kernel startup :

// Run programs on startup using onBoot() method
window.kernel.onBoot((k) => {
    k.start("program--name");
});

Events

  • Events represent signals within the system.
  • Used to communicate between programs without tight coupling.
  • Help reduce duplication in cross-program communication.

Fire events from kernel :

// Fire events using kernel
window.kernel.emit("kernel:test", {
    name: "Naruto Uzumaki",
    age: 18,
    residence: "Konoha village"
});

To listen to events from kernel :

// Add event listener
const listener = window.kernel.on("kernel:test", (e) => {
    console.log("Kernel test event fired :: ", e.detail);
});

// Remove the defined listener
listener();

// To listen to event only once
window.kernel.once("kernel:test", (e) => {
    console.log("Kernel test event fired :: ", e.detail);
});

Request

Requests can be used for API calls.

Request Types :

  • GET
  • POST
  • PUT
  • PATCH
  • DELETE

Create Request :

import { Request } from "/dist/index.js";

export default class GetPosts extends Request {
    get url() {
        return "https://jsonplaceholder.typicode.com/posts";
    }

    get method() {
        return "GET";
    }

    get headers() {
        // Headers can be defined here
        return {}
    }

    get payload() {
        // Request payload can be defined here
        return {}
    }
    
    onProcessing() {
        // Runs while request is running
        console.log("Get posts is processing");
    }

    onSuccess(response) {
        // When request is succeeded
        console.log("Get posts is success :: ", response);
    }

    onError(error) {
        // When request is error
        console.error("Get Posts is error :: ", error);
    }
}

Register request on kernel :

window.kernel.registerRequest({
    "get-posts": GetPosts
});

Run request using kernel :

window.kernel.send("get-posts");

Contributing

Web kernel is an experimental project. Contributions are welcome for experimentation, improvements, and exploration of ideas.

  1. Fork the repository
  2. Create a new branch from develop.
  3. Make your changes with clear, focused commits.
  4. Ensure existing functionality is not broken.
  5. Submit a pull request to the develop branch.
  6. Describe what has changed and why.

License

MIT License