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

@al8b/runtime

v0.1.15

Published

Browser runtime facade for AL8B games. It owns asset loading, VM bootstrap, the frame loop, script-facing globals, bridge-based host integration, hot reload integration, and runtime lifecycle control.

Readme

@al8b/runtime

Browser runtime facade for AL8B games. It owns asset loading, VM bootstrap, the frame loop, script-facing globals, bridge-based host integration, hot reload integration, and runtime lifecycle control.

Public API

  • createRuntime
  • RuntimeController
  • RuntimeBridge
  • RuntimeSnapshot
  • RuntimeSessionSnapshot
  • Re-exports from assets, core, hot-reload, input, loop, storage, system, types, utils, and vm

Runtime Responsibilities

  • Build the global script API (screen, audio, input, player, scene, router, system)
  • Expose host-facing built-ins (host, session, memory)
  • Load assets and compiled routine artifacts or development sources
  • Coordinate the game loop and debug time-machine hooks
  • Route runtime errors, warnings, and bridge events back to the host shell

Host Bridge

Use bridge to connect the runtime to your app shell, backend, or realtime layer.

Recommended: @al8b/http-bridge — provides a production-ready bridge with HTTP/REST support, endpoint mapping, and auth headers. See @al8b/http-bridge.

Manual implementation:

import { createRuntime, type RuntimeBridge } from "@al8b/runtime";

const bridge: RuntimeBridge = {
  emit(name, payload) {
    console.log("game event", name, payload);
  },
  request(name, payload) {
    return fetch(`/api/runtime/${name}`, {
      method: "POST",
      body: JSON.stringify(payload)
    }).then((response) => response.json());
  },
  getSession() {
    return {
      user: { id: "user-1" },
      game: { id: "hello" }
    };
  }
};

const runtime = createRuntime({
  canvas,
  sources,
  resources,
  bridge
});

LootiScript can use:

  • host.emit(name, payload)
  • host.request(name, payload, callback)
  • session.user(), session.player(), session.game(), session.room()
  • memory.export(), memory.import(snapshot), memory.reset(), memory.save(meta, callback), memory.load(meta, callback)

Runtime Lifecycle

RuntimeController now exposes lifecycle and state transfer primitives needed by host apps:

  • start()
  • stop()
  • resume()
  • reset(options?)
  • exportSnapshot()
  • importSnapshot(snapshot)
  • sendHostEvent(event)
  • getSession()

Notes

  • This package is the integration point for most @al8b/* engine packages.
  • createRuntime() is the only supported top-level runtime constructor.
  • Backend access, auth, multiplayer transport, and hub UX stay in the host app or bridge layer, not in runtime core.

Scripts

bun run build
bun run test
bun run clean