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

spektrum

v1.0.1

Published

Tiny reactive engine with HTML bindings and time-travel. ~12kB minified, zero runtime deps, agent-native.

Readme

npm bundle size license types 0 dependencies CI coverage

Live demo →

Spektrum is one file with zero runtime dependencies and no build step. The ~1,100 commented source lines audit in an afternoon, and there's nothing transitive to pick up someone else's CVE from. The same small footprint drops cleanly into a WordPress theme, an MV3 browser extension, an Electron renderer, or any strict-CSP environment — no SPA framework required.

At ~12 KB the whole engine fits in any LLM's context window in one tool call — so when an AI agent writes Spektrum code, it's working from the source, not a guess. attempt() is speculative execution as a primitive: try a change, run validation, commit or discard. describe() returns the full operational manifest. The MCP companion exposes the running app as a tool catalog any MCP-compatible agent can drive.

Every mutation flows through one path — the same path that updates the DOM also writes history. replay(n) reconstructs any past state, deterministically. Ship a serialized history with a bug report and QA reproduces the user's exact actions; build multi-step wizards with native undo; emit audit trails for compliance — all built into the primitive.

What it is

A tiny templating engine with HTML-attribute bindings — {{expr}} for text, :attr for properties, data-action for events, data-each for lists, data-model for two-way inputs. CSP-safe via build-time precompile. Deterministic and synchronous: replay(n) returns to the same state every time. No virtual DOM, no proxies, no CSS-in-JS — the call stack in DevTools matches the source.

<p>{{count}}</p>
<button data-action="click" data-fn="trigger" data-id="count" data-value="1" data-name="inc">+1</button>

<script type="module">
  import { setValue, bindDOM, run } from 'https://unpkg.com/spektrum';
  setValue('count', 0);
  bindDOM();  run();
</script>

That's a working reactive counter. Read the engine in an afternoon, or hand the whole file to an LLM in one tool call.

Why

  • Time-travel. Every mutation recorded. replay(n) rebuilds any past state. Undo / scrub / agent-rollback for free.
  • Auditable. ~12 KB minified, ~5.5 KB gzipped, ~1100 lines, single file, zero runtime dependencies.
  • Drop-in. ESM from a <script type="module"> — works in plain HTML, a WordPress theme, a browser extension, an Electron renderer, anywhere.
  • CSP-safe. Strict-CSP via spektrum/compile.
  • Agent-native. describe() returns the full operational manifest. attempt() is speculative execution. Mount an in-page LLM panel in 5 lines.

Install

npm install spektrum

Or load from a CDN with an importmap so every subpath keeps its bare specifier:

<script type="importmap">
{
  "imports": {
    "spektrum":          "https://unpkg.com/spektrum",
    "spektrum/devtools": "https://unpkg.com/spektrum/companions/spektrum-devtools.min.js",
    "spektrum/persist":  "https://unpkg.com/spektrum/companions/spektrum-persist.min.js",
    "spektrum/inspect":  "https://unpkg.com/spektrum/companions/spektrum-inspect.min.js",
    "spektrum/dock":     "https://unpkg.com/spektrum/companions/spektrum-dock.min.js",
    "spektrum/mcp":      "https://unpkg.com/spektrum/companions/spektrum-mcp.min.js",
    "spektrum/agent":    "https://unpkg.com/spektrum/companions/spektrum-agent.min.js"
  }
}
</script>

For production, pin the version: https://unpkg.com/spektrum@<version>.

Documentation

The depth lives in docs/. Single source of truth, plain Markdown.

| Doc | What's in it | | --- | --- | | Bindings | {{expr}}, :attr, data-if, data-each (with container-not-template rule + reconciliation modes), data-model, data-action, data-ref, data-intent, data-cloak, URL-attribute safety | | Public API | Every export, with examples — setValue, addAsync / refresh, computed, addSystem, defineFn, agent surface | | Time-travel | replay, checkpoint, forks, snapshots, devtools scrubber | | Subpath modules | devtools / persist / compile / mcp / agent / inspect / dock | | Agent workflow | Orient → speculate → explain → commit. Covers the in-page agent panel and MCP catalog | | CSP guide | Strict-CSP deployments via build-time precompile | | Constraints | Non-negotiables that gate every feature | | Trade-offs | Deliberate design choices and their rationale | | Philosophy | Non-goals; the engine in three sentences |

Built with Spektrum

| App | What it is | Live | Source | | --- | --- | --- | --- | | SKYo | Hourly weather, single page | d-dezeeuw.github.io/hourly-weather | github.com/D-dezeeuw/hourly-weather | | Devworld26 guide | Conference schedule navigator | d-dezeeuw.github.io/my-confs | github.com/D-dezeeuw/my-confs | | Subgenre Playlists | Spotify playlist builder with AI track suggestions, SSE-streamed search, nested subgenre/track state | — | github.com/D-dezeeuw/spotify-subgenre-playlists | | Spektrum demo | Counter + basket reference, two isolated instances, devtools, persist, inspect, agent | d-dezeeuw.github.io/spektrum/example | example/ |

Shipped something on Spektrum? Open a PR adding it here.

License

MIT. Browser & Node support, dev commands → docs. Contributing → CONTRIBUTING.md. Security disclosures → SECURITY.md.