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

superbridge

v1.0.5

Published

A powerful, type-safe, and easy-to-use Electron bridge with support for sending callback functions over the bridge

Readme

Superbridge

superbridge is a powerful, type-safe, and easy-to-use Electron bridge with support for sending callback functions over the bridge.

Visit superbridge.dev for full documentation.

npm install superbridge

Setting up

In order to set up superbridge, we need to:

  • Create a bridge (set of functions the client will be able to call)
  • Initialize it in the main process
  • Initialize the bridge in the preload
  • Create the client

These are a bit of boilerplate, but the superbridge API is designed to make it as simple as possible.

Router

First, let's create a simple router. The router is a set of functions that will be available to the client.

In this example, we only create a simple ping function that takes a message and returns a pong with it.

There are many more powerful features, like subscriptions, effects, shared values, etc. We will cover them in the next sections.

import { createRouter } from "superbridge/main";

export const appRouter = createRouter({
  ping(message: string) {
    return `pong ${message}`;
  },
});

export type AppRouter = typeof appRouter; // Will be used to make the client type-safe

Main process

Now, in the main process, we need to initialize the router. This needs to be done before we create the BrowserWindow.

It is as simple as calling initializeSuperbridgeMain with our router.

import { initializeSuperbridgeMain } from "superbridge/main";
import { appRouter } from "./router";

initializeSuperbridgeMain(appRouter);

Preload

Now, we need to allow the client to call our router.

We can do this by calling initializeSuperbridgePreload inside the preload script.

import { initializeSuperbridgePreload } from "superbridge/preload";

initializeSuperbridgePreload();

Client

Finally, let's create the client inside the renderer process.

We do this by calling createSuperbridgeClient with our router type.

import { type AppBridge } from "./handler";
import { createSuperbridgeClient } from "superbridge/client";

export const appClient = createSuperbridgeClient<AppBridge>();

[!NOTE]

It is important to explicitly import AppBridge as a type-only import. Otherwise, the entire router will be bundled into the client, which is also likely to crash, as the router is running in a Node environment, not a browser environment.

Use the client

Now, our client is ready to use!

const pong = await appClient.ping("hello");
console.log(pong); // pong hello

License

This project is licensed under the MIT License - see the LICENSE file for details.