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

ascua

v0.5.0

Published

Runtime reactivo de Ascua: signals, effects y operaciones directas de DOM. Sin Virtual DOM.

Readme

ascua

Reactividad fine-grained y operaciones directas de DOM, en 3,62 kB gzip y sin dependencias. Es el runtime de Ascua, y también una librería de signals que se puede usar sola.

stil add ascua      # o npm install ascua

Signals

import { signal, memo, effect, batch } from "ascua";

const precio = signal(1000);
const cantidad = signal(3);
const total = memo(() => precio() * cantidad());

effect(() => console.log(total()));   // 3000

batch(() => {                          // un solo recálculo, no dos
  precio.set(1200);
  cantidad.set(2);
});                                    // 2400

Escribir en un signal no ejecuta nada: marca. Los efectos afectados se encolan y corren cuando la marca termina de propagarse, así que un grafo en diamante no deja leer valores intermedios y una rama cuyo valor no cambió no recalcula.

DOM

Las mismas llamadas que emite el compilador de Ascua, y que se pueden escribir a mano:

import { element, dynamicText, on, append, mount } from "ascua";

function Contador() {
  const cuenta = signal(0);
  const boton = element("button");
  on(boton, "click", () => cuenta.update((c) => c + 1));
  append(boton, dynamicText(() => `Clicks: ${cuenta()}`));
  return boton;
}

mount(document.body, Contador);

show sustituye una región, list reconcilia por clave —conservando el nodo de cada clave, y con él el foco y el scroll—, attribute y property atan un atributo o una propiedad a una expresión.

SSR e islas

El mismo código renderiza en el servidor, sin navegador ni dependencias, y el cliente adopta los nodos en vez de rehacerlos:

// las islas, compartidas por servidor y cliente
import { defineIsland, p } from "ascua";

export const IslaContador = defineIsland("contador", { inicial: p.number }, Contador);

// servidor
import { collectStyles, renderToString } from "ascua/server";

const html = renderToString(() => IslaContador({ inicial: 3 }));
const css = collectStyles(html);   // el CSS con scope de lo que aparece

// cliente
import { hydrate } from "ascua";

hydrate([IslaContador]);
// { adopted: 4, created: 0, unmount }

Los props viajan como JSON y se comprueban contra el esquema antes de hidratar: si el servidor mandó otra cosa, la isla se queda estática y la consola dice qué campo falló. island es la pieza de debajo, sin esquema, para quien quiera otro formato.

hydrate e island suben el runtime a 4,59 kB, y defineIsland unos 0,75 kB más; lo que no se importa, el tree-shaking se lo lleva. Está explicado en la documentación.

Con plantillas

Lo normal, de todas formas, es no escribir esto: con vite-plugin-ascua se escribe HTML dentro de TypeScript y el compilador lo traduce a estas llamadas.

Licencia

MIT OR Apache-2.0