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

@webgui/svelte

v1.6.0

Published

Svelte stores and types for the WebGUI Minecraft mod — access window.webgui client data from any SPA.

Readme

@webgui/svelte

Requires the WebGUI Minecraft mod (GitHub) to be installed on the client. This library has no effect outside of the mod.

Svelte stores and TypeScript types for SPAs running inside the WebGUI Minecraft mod.

WebGUI embeds a Chromium browser (via MCEF) in-game and injects window.webgui into every page. This library exposes that API as Svelte stores you consume with the $ syntax — no boilerplate.

Installation

npm install @webgui/svelte

Requires Svelte 4+ as a peer dependency.

Quick start

<script lang="ts">
  import { webguiClient, isInMod } from '@webgui/svelte';
</script>

{#if !isInMod()}
  <p>Open this page inside Minecraft.</p>
{:else if $webguiClient}
  <p>Hello, {$webguiClient.username}</p>
{:else}
  <p>Waiting for mod data…</p>
{/if}

API

Stores

| Store | Value | Notes | |---|---|---| | webguiClient | Readable<WebGUIClient \| null> | Live player snapshot, updated at 20 TPS. | | webguiEntity | Readable<WebGUIEntity \| null> | Entity the player right-clicked to open the GUI. | | webguiSelector(fn, eq?) | Readable<T \| null> | Derived store; only changes when the selection changes. |

<script lang="ts">
  import { webguiSelector } from '@webgui/svelte';
  const username = webguiSelector((c) => c.username);
</script>

<span>{$username}</span>

Actions

| Function | Signature | Notes | |---|---|---| | postToGame | (payload) => void | Send a message to the game. | | closeGui | () => void | Close the active GUI/HUD. | | runCommand | (command) => void | Run a command as the player (trusted origins only). | | webguiToken | (name?) => string \| null | Signed token from the page URL (static). | | onWebGUIEvent | (name, handler) => () => void | Subscribe to a server event; returns unsubscribe. |

<script lang="ts">
  import { onMount } from 'svelte';
  import { onWebGUIEvent, runCommand } from '@webgui/svelte';

  onMount(() =>
    onWebGUIEvent<{ balance: number }>('walletUpdate', ({ balance }) => {
      // update local state
    }),
  );
</script>

<button on:click={() => runCommand('spawn')}>Teleport to spawn</button>

TypeScript

All types are exported from the package root (WebGUIClient, WebGUIEntity, PostToGamePayload, …). The package also augments window.webgui and the webgui:client / webgui:entity events globally.

License

MIT