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

@zappdev/runtime

v0.6.0-alpha.19

Published

TypeScript frontend API for [Zapp](https://github.com/zappdev/zapp) desktop apps. Use the same imports in webview code, webview-spawned workers, and headless workers — internal fast paths are automatic.

Downloads

329

Readme

@zappdev/runtime

TypeScript frontend API for Zapp desktop apps. Use the same imports in webview code, webview-spawned workers, and headless workers — internal fast paths are automatic.

Install

The CLI's zapp init scaffolds this package as a dependency. If you're adding it manually:

bun add @zappdev/runtime

Exports

import {
  // App lifecycle
  App,
  Events, AppEvent, type EventName,

  // Windows
  Window, WindowEvent, type WindowHandle, type WindowOptions,
  type WindowPayload, type WindowSizePayload,

  // Screens / displays
  Screen, type Display, type DisplayRect, type CursorPoint,

  // Embedded webviews (<zapp-webview>)
  Webview, ZappWebviewElement, type PanelEvent, type WebviewCreateOptions,

  // IPC to native services
  Services, type InvokeOptions, type CancellablePromise,

  // Workers
  Worker, SharedWorker, SharedWorkerPort, Workers, type WorkerMessageEvent,

  // UI surfaces
  Dialog, type OpenFileOptions, type SaveFileOptions, type MessageOptions,
  Menu, type MenuItemDef, type MenuHandle,
  ContextMenu, type ContextMenuOptions,
  Notification, type NotificationOptions, type ScheduleOptions, type PermissionStatus,
  Dock,
  Tray, type TrayOptions, type TrayHandle, type AttachWindowOptions,

  // System integration
  Clipboard, type ClipboardFormat,
  Shortcuts,
  Protocols, type ProtocolRequest, type ProtocolResponse, type ProtocolHandler,

  // Cross-context coordination
  Sync, type SyncWaitOptions,

  // Helpers
  eventName,
} from "@zappdev/runtime";

Context story

The runtime works in three contexts, same API everywhere, different fast paths under the hood:

| Context | Services.invoke | Window.create | Notification / Dock | |---|---|---|---| | Webview | async IPC through WKWebView (~135 µs) | async IPC | async IPC | | Webview-spawned worker (new Worker()) | direct host-object C call (~5 µs) | direct C call | direct C call (via __zappBridge.notif / .dock) | | Headless worker (from zapp.config.ts) | direct host-object C call | direct C call | direct C call |

You don't write any detection code. The same Services.invoke("foo", args) works everywhere; the runtime picks the right path.

One API difference: Window.current() throws in worker context (a worker doesn't have a "current" window — it's not inside one). Use Window.create() to spawn a window from a worker, or pass a windowId through a service call if you need to act on a specific existing window.

Quick reference

// App lifecycle
App.quit();
App.openExternal("https://...");
App.on(AppEvent.OPEN_URL, (data) => { ... });

// Windows
const w = Window.current();                          // webview only
const w2 = await Window.create({ title: "Second" }); // any context
w.on(WindowEvent.CLOSE, () => { ... });
w.setCloseGuard(true);  // block close; handle in CLOSE event

// Services (Zen-C handlers)
const r = await Services.invoke<{ pong: number }>("ping");

// Events (cross-context bus)
Events.on("data:updated", (d) => { ... });
Events.emit("data:updated", { value: 42 });  // from a worker: broadcasts to all windows

// Cross-context wait/notify
await Sync.wait("ready", 5000);   // → "notified" | "timed-out"
Sync.notify("ready");             // wake one
Sync.notifyAll("ready");          // wake all

// Native UI
await Dialog.openFile({ multiple: true });
Menu.build([{ role: "appMenu" }, ...]);
await Notification.show({ title: "Hello", body: "World" });
Dock.setBadge("3");
const tray = Tray.create({ icon: "build/menubar.png", menu: [...] });

// System integration
await Clipboard.writeText("hello");
await Shortcuts.register("CmdOrCtrl+Shift+K", () => { ... });  // macOS
Protocols.register("asset", async (req) => ({ body: ..., mime: "image/svg+xml" }));

// Screens
const displays = await Screen.getAll();   // bounds / workArea / scaleFactor

// Embedded webview (loads X-Frame-Options-blocked sites; sandboxed)
document.body.appendChild(Webview.create({ src: "https://github.com" }));

Reference

Full API with edge cases, anti-patterns, and worker vs webview semantics: see llms.txt at the repo root. Longer-form guides in docs/api-reference.md.