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

@party-stack/web-runtime

v0.6.3

Published

The main export constructs the platform runtime as an Effect Layer:

Readme

@party-stack/web-runtime

The main export constructs the platform runtime as an Effect Layer:

import { Runtime } from "@party-stack/runtime";
import * as WebRuntime from "@party-stack/web-runtime";
import { Effect } from "effect";

const program = Effect.gen(function* () {
    const runtime = yield* Runtime;
    yield* runtime.bytes.write("example", new Blob(["hello"]));
    // Run the application's scoped services here.
});

await Effect.runPromise(program.pipe(Effect.provide(WebRuntime.layer({ owner: "user", namespace: "app" }))));

Defining the Layer opens nothing. Building it acquires storage, connectivity and platform resources in its Scope. Completion, failure or interruption closes the database, removes listeners, closes channels and releases native locks. No separate platform cleanup() call is needed. The implementation also works in workers, where window and document are unavailable.

Persistent storage uses IndexedDB and OPFS. A persistent replica acquires one native Web Lock for its entire host Scope; another owner waits until that Scope closes or the browser context dies. SharedWorker clients use the standard ontology protocol and memory replicas. BroadcastChannel carries storage invalidations for local private-state projections; it is not an RPC transport or leader-election service. Missing Web Locks fail explicitly for persistent storage.

storage: "memory" selects isolated in-process storage. This is an explicit fallback choice, with memory lifetime; it does not recover pending work from an inaccessible persistent store. Worker support and storage access must be tested separately. Private browsing may provide temporary storage with different quotas. Browser-local encryption key persistence requires an explicit persistEncryptionKeys: true choice.

WebRuntime.layer({ owner: "user", namespace: "app", persistEncryptionKeys: true });

This explicitly permits a non-extractable AES-GCM CryptoKey to survive reloads in IndexedDB, in a separate key database. Same-origin code can still use the key to decrypt; it is not a vault lock or isolation from XSS. Clearing site data loses these keys. The flag enables persistent local credentials but does not opt ordinary encrypted properties into caching. ontology.decrypt(value, { cache: true }) is a separate per-call choice; the default bypasses persistent cached plaintext copies. Cached copies are themselves encrypted with the device key. This runtime must be partitioned by authenticated owner and ontology namespace as usual; never reuse a private runtime for unrelated users. See encrypted values.

createWebRuntime(owner, namespace, options?) returns the same scoped Effect as make({ owner, namespace, ...options }). It has no Promise constructor or manual cleanup method. Installations accept this provider directly; application entry points can supply layer to an Effect program or an outer ManagedRuntime.

Browser tests cover native IndexedDB transactions/notifications, host-lock release on tab termination, and a SharedWorker owner with per-tab memory replicas and TanStack collections. Private browsing/storage access still requires platform testing.