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

@temples/engine

v1.0.0

Published

Declarative DOM-based HTML template engine: data-bind attributes, partial real-time updates, no framework.

Readme

@temples/engine

The standalone, DOM-based templating engine of temples. Templates are plain HTML decorated with a few data-* attributes. The engine renders structured data into them and re-renders single paths for real-time partial updates.

Install

bun add @temples/engine

Works in the browser out of the box. On the server, pair it with @temples/ssr, which wires the engine to a DOM.

Usage

Build a Renderer from a DOM element or an HTML string, then render data into it:

<div id="logged-user">
    <img data-bind="src=user.avatar" src="http://avatar.com/default.png" />
    <div data-bind="user.fullname" class="active">John DOE</div>
</div>
import { Renderer } from "@temples/engine";

const renderer = new Renderer("#logged-user");
renderer.render({
    user: {
        avatar: "http://avatar.com/johndoe",
        fullname: "John DOE",
    },
});

The constructor source is an element id ("#id"), a DOM element, or an HTML string. An id string binds the existing page element in place, so every render writes into the live DOM. An unknown id throws a clear error.

Binding attributes

  • data-bind — inline values: data-bind="src=user.avatar, title=user.fullname". The shorthand (data-bind="user.fullname") sets the text content of non-input elements and the value of form controls. The class attribute supports toggling a value in place: data-bind="class[article|quote|tweet]=article.type".
  • data-iterate — loops: data-iterate="quote: article.quotes". The first child is the row sub-template. Rows are reconciled by key (data-key or item id), so list edits preserve DOM identity, focus, and scroll. data-each and the from keyword are accepted variants.
  • data-render-if — presence conditional: data-render-if="article.featured". A truthy condition keeps the element in the DOM; a falsy condition removes it and a placeholder comment holds its slot until the condition turns truthy again.
  • data-show-if — visibility conditional, same polarity: a truthy condition shows the element, a falsy one hides it with display:none. The element stays in the DOM.
  • data-hide-if — the inverse of data-show-if: a truthy condition hides. Handy when the data names the hiding state itself (data-hide-if="article.hidden").
  • Function values in the data are called and their return value is used as the condition.

Partial updates

render(data) touches only the paths present in data. For a single value, update(path, value) re-renders only the bindings bound to that exact path:

renderer.update("user.status", "away");

Serialization

toHtml() (and its synonym renderToString()) returns the serialized HTML of the rendered template. This is the entry point for SSR and static site generation.

const renderer = new Renderer("<h1 data-bind='article.title'>Title</h1>");
renderer.render({ article: { title: "The Great Race" } });
console.log(renderer.renderToString()); // <h1>The Great Race</h1>

Documentation

Full guides and API reference: https://zipang.github.io/temples/

License

MIT