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

browser-runtime-svelte

v0.0.13

Published

Svelte compiler and renderer adapter for browser-module-runtime.

Readme

browser-runtime-svelte

Svelte 5 compiler and renderer plugin for browser-module-runtime.

Install

npm install [email protected] [email protected] svelte@5

Usage

import {createRuntime} from 'browser-module-runtime';
import {svelte} from 'browser-runtime-svelte';

const runtime = createRuntime({plugins:[svelte({version:'5.39.0'})]});
runtime.define('/Counter.svelte', `<script>let count = $state(0);</script>
  <button onclick={() => count++}>Count: {count}</button>`, {type:'svelte'});
const handle = await runtime.mount({module:'/Counter.svelte',target:'#app'});
// Later: await handle.dispose(); await runtime.dispose();

The adapter uses svelte/compiler and svelte runtime mounting. Generated stylesheet assets are registered and cleaned up with the mount. An exact version contributes a matching svelte package root to the runtime linker so compiled svelte/internal/* imports resolve consistently. Real browser CDN operation depends on the selected provider serving that version.

For HTML declarations of complete .svelte files, prefer type="svelte" with data-src, since nested <script> text cannot safely be embedded in an outer HTML script element.

Children projection in native custom elements (0.0.13-dev.2 source)

The adapter translates authored default children into Svelte 5's children snippet. Since createRawSnippet expects one root element, the snippet owns a span[data-runtime-children] using display:contents; its setup appends clones of all supplied elements/text nodes. This preserves sibling children rather than silently keeping only the first. Components render them through {@render children()}; missing children mean the snippet is undefined. The wrapper affects DOM structure/direct-child selectors, though not the CSS layout box.