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

visualcompose

v0.1.0

Published

Zero-dependency micro-framework for HTML-first apps: URL router, template stamping, fluent API client and declarative data binding. No build step required.

Readme

VisualCompose

HTML-first micro-framework. Router · template stamping · fluent API client · declarative data binding. Zero dependencies · ~5 KB gzipped · no build step · no eval (CSP-friendly) · ESM + types.

CI npm license

Live demo · Architecture · Roadmap · Italiano

Why

Your page is already HTML. VisualCompose keeps it that way: the markup is the template, JavaScript only says where the data comes from and which field goes where. Use it on classic multi-page sites (MPA) or as a small SPA, with the same API.

<ul id="users">
  <li class="user"><a class="link"><b class="name"></b></a></li>   <!-- the visible "mould" -->
</ul>

<script type="module">
  import { VisualCompose } from 'https://cdn.jsdelivr.net/npm/visualcompose/dist/visualcompose.min.js';

  const app = VisualCompose.create({ baseURL: 'https://api.example.com' });

  app.route('/', {
    onEnter: () => app.bind('.user', 'users', {
      '.name': 'name',
      '.link': { href: (u) => `/users/${u.id}` }
    }, { loading: 'Loading…', empty: '<p>No users</p>' })
  }).route('*', { onEnter: () => console.log('404') });

  app.start();
</script>

Install

npm i visualcompose

or via CDN (<script type="module"> as above; for classic scripts use dist/visualcompose.iife.min.js, global VC).

The four pieces (each does one thing)

| Module | Responsibility | |---|---| | Router | Match URL → extract :params and ?query → onEnter / onLeave. Never renders. History or #hash routes. * = 404. | | TemplateRegistry | Turn any source (selector, <template>, HTML string, file URL, fragment) into { content, scripts }, cached pristine. | | ApiClient | app.table('users/:id').params({id}).query({q}).where().sort().limit().get() — fluent fetch, GET cache, automatic invalidation on writes. | | BindingEngine | bind(target, data, mapping, options): clone a mould per item, map fields to nodes, handle loading/empty/error. |

bind() – two modes

  • No template option → target is a visible mould in the DOM: cloned N times, the original is removed, re-binds replace the clones.
  • With template → target is the container, template is the mould; container is refilled (mode: 'replace' | 'append').

Mapping

{ '.name': 'user.name',                     // dotted path → text
  '.avatar': 'avatarUrl',                    // <img> → src, <a> → href, <input> → value
  '.row': { class: (d) => d.active ? 'on' : 'off', 'data-id': 'id', onclick: (d) => open(d) },
  '.pos': '$index',  '.who': 'params.id' }   // special sources

Prefer text over html: html/innerHTML insert raw markup (see SECURITY.md).

Compared to…

| | VisualCompose | htmx | Alpine.js | Vue / React | |---|---|---|---|---| | Build step | none | none | none | usually | | Size (min+gz) | ~5 KB | ~14 KB | ~16 KB | 30–45 KB+ | | Template language | plain HTML | plain HTML + attrs | HTML + directives | SFC / JSX | | Client router | ✔ built in | ✘ (server) | ✘ | add-on | | JSON API client | ✔ fluent + cache | ✘ (HTML over the wire) | ✘ | add-on | | Reactivity / state | ✘ (explicit bind) | ✘ | ✔ | ✔ |

Pick VisualCompose when you have JSON endpoints + server-rendered or static HTML and want routing and rendering without adopting a component model.

Develop

npm install
npm test            # vitest + jsdom
npm run typecheck   # JSDoc types checked by tsc
npm run build       # dist/: esm, esm.min, iife.min, types
npm run serve       # then open /examples/basic/

See CONTRIBUTING.md. License: MIT.