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

@supacloud/contracts

v0.5.0

Published

SupaCloud command protocol with optional client and browser entrypoints

Downloads

346

Readme

@supacloud/contracts

Dependency-free command contracts for browser and server applications. Installing this package does not install Angular, Svelte, a database driver or a DI runtime.

APIs

The root entrypoint exports protocol types, decoders, CommandError and storage port types only. Import optional client APIs from @supacloud/contracts/client and lock implementations from @supacloud/contracts/browser. None are re-exported from the root. This is a breaking import-path change with no framework dependency.

  • createAuthoritativeCommandClient: validate input, acknowledgement and authority independently. By default even a valid acknowledgement triggers one authoritative lookup. One invocation sends at most one write and one lookup; it never retries.
  • createAuthenticatedFetch: obtain a current token before sending over HTTPS. It preserves request credentials and cancellation, rejects redirects, and never refreshes/replays a write after 401. The supplied fetch must itself be single-attempt.
  • createCommandScope (/client): invalidate() aborts old work without destroying a reusable scope; destruction is permanent. Reject stale synchronous state commits. Async callbacks are not accepted by attempt.commit.
  • createDurableCommandLocks (/browser): persistent operation ownership with an atomic coordinator. release checks both operation ID and page ownership inside that coordinator. Storage failures and corrupt data fail closed.
  • createWebLockCoordinator: browser Web Locks implementation; no unlocked fallback.
  • decodeDurableCommandReceipt: runtime-validated pending/unknown/confirmed receipts, with separate audit state. Always supply the domain result decoder.
  • canonicalCommandJson: deterministic, JSON-only persistence input. Rejects cycles, undefined, non-finite numbers and non-JSON objects.

createContractCommandClient remains a thin legacy protocol export. New work should use createAuthoritativeCommandClient: transport acknowledgement and business authority need not have the same shape.

Boundaries

An HTTP status, an acknowledgement or a cancelled request is not proof of rollback. Only configure isDefinitiveWriteFailure for a contract that guarantees no business effect. A lock is not server-side idempotency. Persist operation identifiers before sending, namespace locks by tenant/actor/command/target, and clear only after authoritative confirmation or an explicit domain recovery decision.

Existing authentication providers can be retained through getAccessToken(). Do not supply an authenticated SDK transport that secretly retries writes. The adapter does not make caller-selected URLs trustworthy; use fixed, trusted service origins, never an arbitrary user-supplied URL with a bearer token.

See the complete migration plan, including failure semantics, PostgreSQL adapters, Svelte integration and acceptance commands.

Validation

bun install --frozen-lockfile
bun run typecheck
bun run typecheck:test
bun test
bun run build