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

@fest-lib/ssre

v0.1.19

Published

fest-lib SSR.E: backend-first H/E HTML, object.ts reactivity, Fastify + channel

Readme

ssr.e

Backend-first sibling of LUR.E. Same H / E / M ideas and object.ts refs, but it renders HTML on the server with a scripted reactive scenario — no DOM, overlays, drag, or other client-only LUR.E features.

Optional frontend: load LUR.E / FL-UI / app modules after the page. Live updates go through SSE (default), WebSocket, or socket.io; the envelope is the same shape uniform.ts already proxies.

Default host is Fastify. Vite is supported via ssreVite() (npm run demo).

Layer

core → object / uniform → ssre          (backend)
                         ↘ lure / …     (optional client, after HTML)

ssr.e must not import lur.e or dom.ts.

Render

import { E, M, createHub, numberRef, observe, renderPage } from "@fest-lib/ssre";

const hub = createHub();
const count = hub.store("count", numberRef(0));
hub.action("inc", () => { count.value += 1; });

const html = renderPage({
  title: "SSR.E",
  hub,
  channel: { url: "/ssre/channel", protocol: "sse" },
  factory: () => E("main", {}, [
    E("p", {}, ["Count: ", count]),
    E("button", { on: { click: "inc" } }, "+1"),
    M(hub.store("items", observe(["a"])), (item) => E("li", {}, item)),
  ]),
});

The document includes #ssre-scenario JSON and an inline hydrate script. Bindings stay live without LUR.E.

Fastify

import Fastify from "fastify";
import { createHub, ssrePlugin, numberRef, E } from "@fest-lib/ssre";

const hub = createHub();
const count = hub.store("count", numberRef(0));
hub.action("inc", () => { count.value += 1; });

const app = Fastify();
await app.register(ssrePlugin({ hub }));
app.get("/", (_, reply) => reply.ssre({
  title: "SSR.E",
  factory: () => E("p", {}, ["Count: ", count]),
}));

GET /ssre/channel is SSE. POST /ssre/channel applies { t: "set" | "action", ... }.

Sockets (optional peers): ws, @fastify/websocket, socket.io / socket.io-client. Node's built-in WebSocket is a client only. Helpers: listenWithWs, listenWithSocketIO, attachFastifyWebsocket. hubAsUniformTarget(hub) is a duck-typed port for uniform.ts.

CSS (vanilla only)

Reactivity is proxied object.ts refs → CSS custom properties. No SCSS. Optional css-tree parse if installed.

cssVars({ "--pad": padRef }, { typed: { "--pad": "px" } }, hub);
E("div", { css: { accent: colorRef } }, "…");

The page emits #ssre-css. The client applies style.setProperty and, when present, Typed OM (CSS.px / attributeStyleMap) from the typedOm map.

Icons, images, FS

  • Icon({ icon, src }) emits <ui-icon> (name / resource path). Drawing is client @fest-lib/icon.
  • picture(src, { widths }) writes srcset (file-640w.jpg or ?w=). Optional resize: @napi-rs/canvas or canvas via resizeImageBuffer.
  • createFsRoot(dir) is the backend analog of LUR.E OPFS (@fest-lib/ssre/fs). Paths cannot leave root.
  • H defaults to the builtin tokenizer. Opt into jsdom, @xmldom/xmldom, or node-html-parser via setHtmlEngine("jsdom") or SSRE_HTML_ENGINE. createHtmlDocument() returns the peer document + serialize().

Vite

import { ssreVite } from "@fest-lib/ssre/vite";

export default {
  plugins: [ssreVite({ pages: { "/": "./pages/home.ts" } })],
};

Page module: export default ({ hub }) => ({ title, factory }).

Tests

npm test          # node:test via Vite bundle
npm run demo      # Vite + ssreVite, http://localhost:5173/

A Fastify-less backend is test/demo/server.ts.