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

@gyral/core

v0.3.6

Published

Gyral core: Model-View-Intent web components on the web platform, with their own view layer.

Downloads

1,540

Readme

@gyral/core

Model-View-Intent web components on the web platform, with their own view layer. Intent parses platform events into typed messages, the model is a set of pure reducers, and the view is a pure template that names intents. Side effects are commands: data that drivers run at the edges.

Install

pnpm add @gyral/core

Example

import { define, html } from '@gyral/core';

type Msg = { _tag: 'Increment' } | { _tag: 'Decrement' };

define<{ count: number }, Msg>()('gy-counter', {
  init: () => ({ count: 0 }),
  intent: {
    Increment: true,
    Decrement: true,
  },
  update: {
    Increment: (s) => ({ count: s.count + 1 }),
    Decrement: (s) => ({ count: s.count - 1 }),
  },
  view: (s, i) => html`
    <output>${s.count}</output>
    <button type="button" data-intent=${i.Decrement}>Decrement</button>
    <button type="button" data-intent=${i.Increment}>Increment</button>
  `,
});

@gyral/core/vite exports gyralVitePreset(), the Vite/Vitest settings every Gyral app needs (the build-time template compiler). @gyral/core/eslint is an ESLint plugin with the same template rules for the editor (import gyral from '@gyral/core/eslint', then gyral.configs.recommended in your flat config). @gyral/ssr renders components and pages to HTML on the server. In tests, await settled() waits until every component has rendered and messages have stopped arriving.

Documentation

@gyral/core/storage exports makeLocalStorageDriver(schema, { prefix?, name?, storage?, encode? }): JSON Read/Write/Remove/Clear commands and cancellable Watch streams. Reads validate persisted values with Standard Schema; watches report invalid data and keep listening. Driver writes and native other-tab events produce changes. Clear respects the prefix namespace. Start initial watches in subscriptions so SSR state hydrates first; imports and factories do not access browser globals. This optional entry is absent from apps that do not import it. See the storage guide.

@gyral/core/indexeddb exports makeIndexedDBDriver(stores, { database, version, upgrade?, name?, factory?, encode? }): typed Read/Put/Delete, bounded Query and atomic Transaction batches. Applications own stores, indexes and synchronous migrations. Success means the native transaction committed; stored records decode afterward. Blocked upgrades, access and decoding failures are typed. Commands close connections and cancel native work; an already committed write cannot be undone. This entry is also optional and SSR-safe.

Guides and API reference: gyral.dev. Source, issues and the consumer setup guide (packages, Vite preset, template compiler): github.com/gyraljs/gyral.

Status: 0.x, on npm. Breaking changes to the public API come only in a new minor version, with a migration guide.

Diagnostic codes

Production builds print codes such as Gyral G0010 my-cart Increment. The full table (code, group, message, arguments, link) ships with the package as @gyral/core/errors.json, for tools and docs sites: import errors from '@gyral/core/errors.json' with { type: 'json' };. The same table, rendered: https://gyral.dev/errors/.

License

MIT © Mike Zupper. See LICENSE and NOTICE (Cycle.js attribution). Gyral, gyraljs and the Gyral logo are trademarks of Mike Zupper.