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

@ai-slot/runtime

v0.2.0

Published

Zero-dependency <ai-slot> Web Component runtime for AI-enhanced pages with guaranteed fallback.

Readme

@ai-slot/runtime

Zero-dependency <ai-slot> Web Component runtime for ai-slot-component: wrap existing markup, fetch a validated component tree from the proxy, and render it through a registered adapter — with a guaranteed fallback to your original content.

Install

npm install @ai-slot/runtime

Usage

<ai-slot name="hero" src="/ai-render/hero" editable stream live>
  <h1>Original content — stays in the page as the fallback</h1>
</ai-slot>

<script type="module">
  import { configureAiSlot, registerRenderer } from "@ai-slot/runtime";
  import { createDomRenderer } from "@ai-slot/adapter-dom";

  registerRenderer("dom", createDomRenderer(components));
  configureAiSlot({ registry, onFailure: (f) => console.debug(f) });
</script>

Element attributes: src, name, renderer (default dom), editable, stream (SSE skeleton → tree), live + live-src (invalidation push), refresh-interval, fresh-only.

卸载元素时,在途的加载结果会被忽略;同一实例重新挂载后会重新核对内容。live 通道每次成功连接也会核对一次,因此初次挂载的加载与连接后的核对可能并发读取,由最新一次加载结果决定显示内容。

fresh-only 是挂载前配置的可选管理内容边界:需先通过 configureAiSlot({ registry }) 配置注册表,且服务端必须在通过校验的最终树响应 meta.expiresAt 中提供可信的 Unix 毫秒截止时间。缺失、非法、已过期或后续更新失败时,槽位恢复原始兜底;当前显示的树到期也会恢复。运行时使用访客本机时钟,并在页面重新可见时复核。后台标签页的定时器节流或错误的系统时钟可能延迟撤回,不能保证所有访客在截止毫秒立即消失。普通槽位保持原有行为,不要求期限元数据。属性和 live 一样应在挂载前配置。

Wire format APIs: registerWireFormat(id, format) / unregisterWireFormat(id) plug alternative wire formats into the fetch pipeline. Failures are observed via onFailure as FetchFailure { stage: "http-non-ok" | "parse" | "validate" | "fetch-error", message } — set it globally in configureAiSlot or per call on fetchComponentTree. The silent-fallback behavior never changes; the hook is observation only.

Registration must happen synchronously in the same module graph that imports the runtime — custom element upgrade is synchronous.

Docs

  • Root README — full attribute table and framework examples

License

MIT