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

@gd-kirie/platform

v0.6.3

Published

Downloads

1,847

Readme

@gd-kirie/platform

@gd-kirie/platform exposes browser-side desktop capabilities supplied by the Godot host. Create the client from an existing @gd-kirie/ipc-eventa context.

import { createContext } from "@gd-kirie/ipc-eventa";
import { createPlatformClient } from "@gd-kirie/platform";

const eventa = createContext();
const platform = createPlatformClient(eventa.context);

await platform.hostWindow.setAlwaysOnTop(true);

const windowBounds = await platform.hostWindow.getBounds();
const displayBounds = await platform.hostWindow.getCurrentDisplayBounds();
const pointer = await platform.hostWindow.getPointerPosition();
const windowState = await platform.hostWindow.getState();
console.log(windowBounds, displayBounds, pointer, windowState);
eventa.dispose();

Request/response capabilities are methods on the returned client. Host-initiated events are exported @moeru/eventa contracts; subscribe to them on the same context and the returned function unsubscribes.

External URLs

Use openExternalUrl() to open an absolute HTTP or HTTPS URL with the system browser:

await platform.openExternalUrl("https://example.com");

The Godot host rejects relative URLs and other URI schemes. It uses OS.shell_open() to select the system browser.

Use openApplicationDataDirectory() to open the current Godot application's data directory and receive its absolute path:

const path = await platform.openApplicationDataDirectory();

This capability does not accept an arbitrary path.

Host window

  • window position and size in screen coordinates
  • current display position and size in screen coordinates
  • pointer position relative to the host window, including while it is click-through
  • pointer passthrough
  • native move and resize gestures
  • always-on-top
  • centering on the current display
  • visibility, focus, and minimized-state snapshots and change events

Pointer coordinates use host-window pixels and are not normalized to the browser viewport. getPointerPosition() returns a single snapshot.

getState() returns one lifecycle snapshot and starts native state observation. Call it once during setup. Later changes arrive as hostWindowStateChanged events; subscribe with context.on(hostWindowStateChanged, ({ body }) => ...) and call the returned function to unsubscribe.

Global shortcuts

The macOS and Windows hosts can register a shortcut that remains active while the Godot window is hidden or unfocused:

const shortcut = {
  keycode: 0x4b, // Godot Key.K
  shiftPressed: false,
  altPressed: false,
  ctrlPressed: false,
  metaPressed: false,
  commandOrControlAutoremap: true,
};

await platform.globalShortcuts.register(shortcut, ({ state }) => {
  console.log(state); // "pressed" or "released"
});

await platform.globalShortcuts.unregister(shortcut);

keycode uses Godot's logical Key values. Every modifier field is required; commandOrControlAutoremap selects Command on macOS and Control on Windows. One onKeyEvent handler receives both states; keyboard auto-repeat does not produce extra calls.

Desktop notifications

Desktop notifications are available on macOS 11 or later and on Windows 10 version 1607 or later:

import { notificationActivated } from "@gd-kirie/platform";

const stop = context.on(notificationActivated, ({ body }) => {
  if (body)
    console.log(`The user clicked ${body.id}`);
});

await platform.notifications.show({
  id: "assistant-answer-42",
  title: "AIRI",
  body: "The answer is ready.",
});

stop();

The first macOS show() requests permission. Windows does not show a permission prompt; show() fails when notifications are turned off. IDs and titles must not be empty. With multiple Platform hosts, a click reaches only the Eventa context that published the notification. Click events end when the Platform host is disposed and do not survive a cold launch. The Windows identity follows the running executable. Linux backends are not implemented.

System back

Android delivers the system Back button as a Platform event. The application decides what Back means:

import { backRequested } from "@gd-kirie/platform";

const stop = context.on(backRequested, () => {
  console.log("The system Back button was pressed.");
});

stop();

To handle Back instead of letting Android close the application, set SceneTree.quit_on_go_back to false. The event is not emitted on platforms without a system Back button.