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

@reactre/dom

v0.0.4

Published

Templates parsed once and cloned, typed holes, and keyed lists that make the fewest DOM moves.

Readme

@reactre/dom

Templates and keyed lists for the DOM, with no build step and no dependencies. A template is parsed once and cloned with its values; a change rewrites only the hole whose value changed. A keyed list reuses rows and makes the fewest DOM moves.

It is the layer @reactre/core renders TSX on, and you can use it directly from plain JavaScript or TypeScript.

bun add @reactre/dom

A template

import { html, on, text } from "@reactre/dom";

let count = 0;

const Counter = html`<button onclick=${on<"click">()}>Clicked ${text<number>()} times</button>`;
const view = Counter.mount([() => view.set(1, ++count), count]);

document.body.append(view.root);

html parses the template once per call site. mount clones it with values for its holes, in order, and set writes one hole, only when its value changed.

Each hole is typed: text<number>() takes a number, on<"click">() a click handler, and a hole in the wrong place is an error when the template is first parsed, never per instance.

A keyed list

import { html, List, text, type BlockOf } from "@reactre/dom";

type Todo = { id: number; title: string };

const Item = html`<li>${text()}</li>`;
const list = new List<Todo, BlockOf<typeof Item>>(document.querySelector("ul")!, {
  key: (todo) => todo.id,
  create: (todo) => Item.mount([todo.title]),
  update: (item, todo) => item.set(0, todo.title),
});

const todos = [
  { id: 1, title: "Write the docs" },
  { id: 2, title: "Ship it" },
];
list.set(todos);
list.set([...todos].reverse()); // both rows are kept; one moves

API

| Export | What it does | | ----------------------------- | -------------------------------------------------------------------------------------------------- | | html, svg | A template, parsed once per call site, with typed holes. | | text, cls, attr, prop | Value holes: text content, the class, an attribute, a DOM property. | | on, slot | An event handler hole, and a place to insert other content. | | Template.mount(values) | Clones the template with its hole values and returns a Block. | | Block.set(index, value) | Writes one hole, and only when the value changed. | | List | A keyed list: reuses rows by key and keeps the longest run in place, so it moves the fewest nodes. | | morph(target, nodes) | Patches a live subtree to match freshly built nodes. |

Browsers and bundlers

It runs in every modern browser. Where the browser has moveBefore, moved rows keep focus, selection and running animations.

The package ships ES modules in dist/ for browsers, bundlers and other runtimes, with their type declarations, and its TypeScript sources, which Bun runs directly. Editors and type checkers read the declarations, so your compiler settings never type-check reactre's sources.

License

Apache-2.0