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

@llui/dom

v0.0.3

Published

LLui runtime — TEA component model, mount, scope tree, bindings, structural primitives, element helpers

Readme

@llui/dom

Runtime for the LLui web framework — The Elm Architecture with compile-time bitmask optimization.

No virtual DOM. view() runs once at mount, building real DOM nodes with reactive bindings that update surgically when state changes.

Install

pnpm add @llui/dom

Quick Start

import { component, mountApp, div, button } from '@llui/dom'

type State = { count: number }
type Msg = { type: 'inc' } | { type: 'dec' }

const Counter = component<State, Msg, never>({
  name: 'Counter',
  init: () => [{ count: 0 }, []],
  update: (state, msg) => {
    switch (msg.type) {
      case 'inc':
        return [{ ...state, count: state.count + 1 }, []]
      case 'dec':
        return [{ ...state, count: state.count - 1 }, []]
    }
  },
  view: ({ send, text }) => [
    button({ onClick: () => send({ type: 'dec' }) }, [text('-')]),
    text((s) => String(s.count)),
    button({ onClick: () => send({ type: 'inc' }) }, [text('+')]),
  ],
})

mountApp(document.getElementById('app')!, Counter)

View<S, M> — the helper bundle

view receives a single View<S, M> bag. Destructure what you need — send plus any state-bound helpers. TypeScript infers S from the component definition, so no per-call generics:

view: ({ send, text, show, each, branch, memo }) => [
  text(s => s.label),                    // s is State — inferred
  ...show({ when: s => s.visible, render: () => [...] }),
  ...each({ items: s => s.items, key: i => i.id, render: ({ item }) => [...] }),
]

Element helpers (div, button, span, etc.) stay as imports — they're stateless and don't need the S binding.

API

Core

| Export | Purpose | | --------------------- | ------------------------------------------------- | | component(def) | Create a component definition | | mountApp(el, def) | Mount a component to a DOM element | | hydrateApp(el, def) | Hydrate server-rendered HTML | | flush() | Synchronously flush all pending updates | | createView(send) | Create a full View bundle (for tests/dynamic use) |

View Primitives

| Primitive | Purpose | | ------------------------------ | --------------------------------------------- | | text(accessor) | Reactive text node | | show({ when, render }) | Conditional rendering | | branch({ on, cases }) | Multi-case switching | | each({ items, key, render }) | Keyed list rendering | | portal({ target, render }) | Render into a different DOM location | | child({ def, key, props }) | Full component boundary (Level 2 composition) | | memo(accessor) | Memoized derived value | | selector(field) | O(1) one-of-N selection binding | | onMount(callback) | Lifecycle hook (runs once after mount) | | errorBoundary(opts) | Catch render errors | | foreign({ create, update }) | Integrate non-LLui libraries | | slice(h, selector) | View over a sub-slice of state |

Composition

| Export | Purpose | | ----------------------------------------- | -------------------------------- | | mergeHandlers(...handlers) | Combine multiple update handlers | | sliceHandler({ get, set, narrow, sub }) | Route messages to a state slice |

Context

| Export | Purpose | | ---------------------------------- | ------------------------ | | createContext(defaultValue) | Create a context | | provide(ctx, accessor, children) | Provide value to subtree | | useContext(ctx) | Read context value |

Element Helpers

50+ typed element constructors: div, span, button, input, a, h1-h6, table, tr, td, ul, li, img, form, label, select, textarea, canvas, video, nav, header, footer, section, article, p, pre, code, and more.

SSR

| Export | Purpose | | --------------------- | ----------------------------------------------- | | renderToString(def) | Render component to HTML string | | initSsrDom() | Initialize jsdom for SSR (from @llui/dom/ssr) |

Sub-path Exports

import { installDevTools } from '@llui/dom/devtools' // dev-only, tree-shaken
import { initSsrDom } from '@llui/dom/ssr' // server-only
import { replaceComponent } from '@llui/dom/hmr' // HMR support

Performance

Competitive with Solid and Svelte on js-framework-benchmark. 5.8 KB gzipped.

License

MIT