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

@qhel/react

v0.1.0

Published

React bindings for @qhel/sdk: reactive live workspaces via useSyncExternalStore. React Native/Expo first, browser too.

Readme

@qhel/react

Bindings de React para @qhel/sdk: workspaces en vivo, reactivos, vía useSyncExternalStore. Pensado para React Native / Expo primero, y también para navegador. Una sola conexión compartida por todos los hooks bajo el provider.

  • Estado en vivo: useWorkspace(ws) re-renderiza cuando cambia el workspace.
  • Escrituras: useQhelActions() (create/update/remove + búsquedas semánticas).
  • Conexión como producto (ADR-009): useConnectionState() y useReady().
  • Seguro en StrictMode: connect/dispose son idempotentes y con recuento de referencias (el doble montaje de StrictMode no abre sockets duplicados).

Instalación

npm install @qhel/react @qhel/sdk
# o: pnpm add @qhel/react @qhel/sdk

react (>=18) es una peer dependency: la aporta tu app (RN/Expo o navegador). useSyncExternalStore requiere React 18 o superior.

Quickstart

Crea el cliente una vez y envuelve tu árbol con QhelProvider. Las credenciales (url y token) se obtienen del panel de Qhel; el alcance del token es a nivel de proyecto (ver el README del SDK antes de embeberlo en una app pública).

import { Qhel } from "@qhel/sdk";
import { QhelProvider, useWorkspace, useQhelActions, useConnectionState } from "@qhel/react";

const db = new Qhel({ url: "wss://<tu-engine>", token: "<token-del-proyecto>" });

export function App() {
  return (
    <QhelProvider
      client={db}
      // El "wow": tu creación se parece a algo EXISTENTE, detectado por significado.
      handlers={{
        onDuplicate: (item, matchId, score, sourceId) =>
          console.log(`"${sourceId}" ≈ "${matchId}" (${Math.round(score * 100)}%)`, item),
      }}
    >
      <Inbox />
    </QhelProvider>
  );
}

function Inbox() {
  const items = useWorkspace("inbox"); // en vivo: se re-renderiza al cambiar
  const { create, remove } = useQhelActions();
  const state = useConnectionState(); // connecting | connected | reconnecting | offline

  return (
    <>
      <span>{state}</span>
      <button onClick={() => create("inbox", { id: crypto.randomUUID(), workspace: "inbox", fields: { title: "Nueva tarea" } })}>
        Añadir
      </button>
      <ul>
        {items.map((item) => (
          <li key={item.id} onClick={() => remove("inbox", item.id)}>
            {String(item.fields.title ?? "")}
          </li>
        ))}
      </ul>
    </>
  );
}

En React Native usa newId() de @qhel/sdk en lugar de crypto.randomUUID().

API

| Símbolo | Qué hace | | --- | --- | | QhelProvider | Posee la conexión (connect al montar, dispose al desmontar) y reparte el store por contexto. Reenvía handlers cambiantes sin reconstruir la conexión. | | useWorkspace(ws) | readonly Item[] en vivo del workspace. Al usarlo por primera vez lo prima (list inicial + subscribe). La referencia del array es estable hasta que el workspace cambia de verdad. | | useQhelActions() | Acciones estables de uso común: create, update, remove, check, similar, search. El resto de la API (abajo) va por useQhelClient(). | | useConnectionState() | Estado de conexión (S1). | | useReady() | true cuando el handshake ya se completó (seguro para leer/escribir en vivo). | | useQhelClient() | El cliente Qhel subyacente, para las operaciones no cubiertas por useQhelActions: query (WHERE/orderBy/keyset), count, getMany, increment/decrement, transaction, removeField, export/Qhel.toImportable, bulkLoad, list, clearWorkspace, y CAS (expectedVersion en update/remove). | | useQhelStore() | El store crudo (uso avanzado). Lanza fuera de un QhelProvider. |

Offline-first

Las escrituras se enrutan en el propio SDK: en vivo si hay conexión, o a la cola CRDT offline si no, reconciliadas al reconectar (ADR-008). Para que la cola sobreviva a un cierre de la app, pasa storage al construir el Qhel (ver el README del SDK); estos hooks no necesitan configuración adicional para ello.

Licencia

SEE LICENSE IN LICENSE.