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 🙏

© 2025 – Pkg Stats / Ryan Hefner

svelte-runner

v1.0.0

Published

Run svelte components. Zero configuration necessary.

Downloads

5

Readme

Svelte Runner

Run svelte components. Zero configuration necessary.

Quick start

yarn global add svelte-runner
svelte-runner dev

Bundles App.svelte and all it's dependencies. It then serves up the bundled code on port 3000, using HMR to instantly update the app when the source code is updated.

Want more customization than that? Don't worry, check out the docs. Customization is by no means overlooked.

Why?

There's more than one reason...

I love things to be simple and efficient. Why not accomplish the work that is generally done by multiple configuration files in one cli command? It's also a lot easier to update one dependency, than to have to continually track nollup, rollup, typescript, svelte, svelte-hmr, etc., while always having to worry about their compatibility to each other.

NodeJS is not the only language that I use. Keeping away from project root configurations for multiple frameworks across multiple languages is a high priority for me.

Ships to a single binary. It would be chore indeed to name all the benefits of this.

CLI Usage

Usage: svelte-runner [options] [command]

Options:
  -V, --version                output the version number
  -e, --entry-file <file>      Initial file.  Code should be svelte, js, or ts (default: "App.svelte")
  -i, --icon <imageFile>       Path to the favicon
  -t, --title <string>         Title of the app
  -o, --open                   Open the app in default browser
  -p, --port <number>          Port to start the app on (default: "3000")
  --host <host>                Host to bind to (default: "localhost")
  --real-favicon <fileOrJSON>  Json options for real-favicon
  --headers <fileOrTags>       Extra tags to be inserted into the <head> of the template
  --template <stringOrFile>    Custom template (index.html)
  --static-map <fileOrJSON>    Static map.  https://github.com/Vehmloewff/svelte-runner#static-map
  --add-script <file>          Path to an additional js file to be inserted into the app's head
  -h, --help                   display help for command

Commands:
  dev [options]                Serves the app in a development environment
  prod [options]               Serves up the app in a production environment
  help [command]               display help for command

Programmatic Usage

yarn add svelte-runner -D
import { dev, prod } from 'svelte-runner'

await dev(coreOptions, devOptions)
// or
await prod(coreOptions, prodOptions)

For more information on what the options are, check out src/types.ts.

Static Map

Static maps tell svelte-runner how to serve up static content.

{
	"/api/**": {
		"proxy": {
			"host": "localhost",
			"port": "8080"
		}
	},
	"/**": {
		"searchIn": "assets"
	},
	"GET /**": {
		"serve": "template"
	}
}

When a request comes in, svelte-runner will follow these steps:

  • If the path matches /_sr-gen/main.js, the compiled and bundled svelte code will be served. Otherwise
  • If the path matches /_sr-gen/main.css, the bundled css code will be served.
  • If the path matches the first pattern, /api/**, the request will be relayed to localhost:8080.
  • If the path matches the second pattern, /**, ask the folder assets if it contains a file whose path represents the part of the path represented by the wildcard (**). If a matching file is not found, continue.
  • If the method of the request is GET, serve up the app template (index.html).

Known issues

  • "Additional watch scripts" support with live reloading does not work at present.