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

@bradensbay/globals

v0.2.1

Published

Electron integration over the native transport: the owner in the main process, preload-mapped regions for trusted windows, and the asynchronous tier for windows that keep their sandbox.

Readme

@bradensbay/globals

The Electron integration for Globals over the native transport (ADR 0003): the owner is a plain object in the main process, trusted windows map one shared memory region from their preloads and read synchronously, and windows that keep their sandbox get the asynchronous tier.

The trade, first: a window that maps the region runs with sandbox: false. Context isolation stays on and the page gets no Node access, but the Chromium OS sandbox for that renderer is off. A window that must keep its sandbox uses the asynchronous tier and never maps anything.

Main process

import { startNativeOwner } from "@bradensbay/globals";

const owner = await startNativeOwner({
  initial: { count: 0, rows: [] },
  operations: {
    increment(draft, payload: { by: number }) {
      draft.count += payload.by;
    },
  },
  persistence: {}, // optional: rehydrate on boot, save commits under userData
});

owner.store.get();                 // the owner reads its own store synchronously
await owner.update((draft) => …);  // or writes it directly

A trusted window's preload, with sandbox: false

import { connectNative } from "@bradensbay/globals/preload";

const store = await connectNative();
store.get();                        // synchronous, never stale, never torn
store.select(["rows", 3, "name"]);
await store.dispatch("increment", { by: 1 });

Expose whole operations to the page through contextBridge, not per-property reads: a bridge crossing costs about a microsecond, so the decode layer belongs on the preload side. The example application shows the shape.

A sandboxed window

// main process
import { asyncPreloadPath } from "@bradensbay/globals";
new BrowserWindow({ webPreferences: { preload: asyncPreloadPath(), sandbox: true } });

The page receives window.globalsAsync: read(path?), dispatch(operation, payload), and subscribe(listener). There is no synchronous get on this tier, deliberately.

Full guide: docs/electron.md.