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

@frondruntime/sorus

v0.3.1

Published

Glitch-free reactive state: boxes, computed values, keyed collections, and updates.

Readme

@frondruntime/sorus

Sorus is a glitch-free reactive state library for applications. It emphasizes:

  • Granular reads and updates. Only what read a changed value runs again.
  • Cached derived values. A computed value runs once and recomputes only after a source it read changes.
  • Observation-driven lifecycles. A source is live while something observes it, and Source.onObserved starts and stops its work.
  • Hard edges. One way to declare a model, one way to write, and errors instead of silent misuse.
  • Code an agent writes and a person reviews. Every read is a read($x) call and every write sits inside Realm.update, so a mistake is a type error or an error that names the call, not a value that silently stops updating. The cost is more code than implicit tracking.

This package is plain Sorus and imports nothing from Effect. Sorus is before 1.0: any release may change the API. It was called Pinna through 0.2.1.

Packages

| Package | Purpose | | --- | --- | | @frondruntime/sorus | The main package: realms, boxes, computed values, atoms, keyed collections, models, views, stages, atomic updates, and watchers. No Effect. | | @frondruntime/sorus-react | React hooks: useValue, useValues, useSelect. React 19 or later. | | @frondruntime/sorus-effect | Opt-in, for an application already on Effect: boxes that check an Effect Schema on every write, models decoded from the wire, and Effect programs that react to state. effect 4.1 or a later 4.x. | | @frondruntime/sorus-core | The raw reactive graph (cells, derived values, atoms, watchers, reactions) with no runtime dependencies, for code that builds on the graph itself. |

Quick start

| Package manager | Command | | --- | --- | | Bun | bun add @frondruntime/sorus | | npm | npm install @frondruntime/sorus | | pnpm | pnpm add @frondruntime/sorus | | Yarn | yarn add @frondruntime/sorus |

import { Box, Computed, Realm, Source } from "@frondruntime/sorus";

const realm = Realm.make();
const $count = Box.make(realm, 0);
const $double = Computed.make(realm, (read) => read($count) * 2);

Realm.update(realm, (read, write) => {
  write($count, read($count) + 1);
});

Source.peek($double); // 2

A box changes only inside Realm.update, through the write it hands out. A write anywhere else, or a write kept past its update, throws and says where to write instead. The recipe is atomic: watchers see its end state once, and a recipe that throws is undone, except a write.changed on an atom, whose watchers still run. For React, add @frondruntime/sorus-react; for boxes that check a schema, @frondruntime/sorus-effect.

Building blocks

| Concept | Made with | What it is | | --- | --- | --- | | Realm | Realm.make() | Holds every observable it makes, with its updates, tracking, watchers, and errors. There is no default realm. | | Box | Box.make(realm, initial) | One value, written only inside Realm.update. A write equal to the current value under Object.is notifies nobody. | | Computed value | Computed.make(realm, (read) => ...) | A cached value derived from what its function reads. | | Atom | Atom.make(realm) | A change signal for state kept outside Sorus: read($atom) subscribes, and write.changed($atom) reruns what observed it. | | Collection | Collection.make(realm, { keyOf }) | Rows by key. $items.keys and $items.rows are computed values of the keys, and of every row, in order. | | Model | class Counter extends Model.Class | A class whose fields are made against this.realm and whose methods write through Realm.update. | | View | View.ordered, View.grouped, View.totals | A sorted order, the keys of each group, or totals per group over a collection, kept a row at a time. | | Stage | Stage.make(realm) | Holds the writes of asynchronous work: Stage.apply lands them in one update, Stage.drop discards them. |

Costs

  • Adding or removing rows in a large collection is the weak spot, not table size or update rate. A collection changes its key order in place while nothing holds it. A read of keys (an autorun, a computed value, a view), an open visible stage, or a Realm.onUpdate listener holds it, and the first add or remove after that read copies the order: about 15 µs at 1,000 rows and 120 µs at 10,000 on Hermes, measured with the order held. A remove that copies nothing still finds and splices the key, linear in the number of rows. Many new rows go in through one write.replaceAll, which copies once.
  • Explicit reads cost more code per read and write, by design.

Exports

| Entry | Exports | | --- | --- | | @frondruntime/sorus | Realm (make, update, untracked, watch, autorun, onUpdate, isTracking, status, dispose), Box.make, Computed (make, fn, fromPromise), Atom.make, Collection (make, reconcile, onRowChange), Model.Class, View (ordered, grouped, totals, status, dispose), Stage (make, update, read, realmRead, apply, drop, status, inspect), Source (peek, observe, onObserved, inspect); the errors SorusError, SorusUsageError, ValueRejectedError, StageClosedError, StageConflictError, and isSorusError; and their types | | @frondruntime/sorus/testing | testRealm, record, held, retainedKeys | | @frondruntime/sorus/internal | What sorus-effect and sorus-react build on; not for applications |

AGENTS.md, shipped in this package, holds the rules for agents writing applications on Sorus. The agent skills carry them one task at a time: npx skills add frondruntime/sorus.

Documentation