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

vscode-webview-extension-svelte-generator

v1.2.6

Published

A template repository to quickly make a Visual Studio Code Webview Extension using Svelte 5 and Rollup

Readme

VSCode-Webview-Extension-Svelte

A template repository to quickly make a Visual Studio Code Webview Extension using Svelte 5 and Rollup

This repo gives you everything you need to start making your own webview extensions using the power and reactivity of Svelte. It automatically comes with everything you need, from components to CSS.

Startup

You can create a template repository by running npx vscode-webview-extension-svelte-generator folder-name in your terminal.

After you create your repo, follow the install steps to get started. To run your extension, you can run npm run compile to begin compiling the frontend and backend, and press F5 to start the Extension enviroment.

You can find the extension by pressing Ctrl-Shift-P and navigating to Hello World.

When you do make a change on the front or backend, use Ctrl-R on your Extension Environment to see the changes. You can also close the webview page and reopen it using Ctrl-Shift-P.

After that, you are good to go! Read the Directory Composition section to see where to find which files. Read the Examples section to see examples of what to do.

Directory Composition

Front End

This is your webview itself and all files pertaining to it:

| File / Folder | Use | | ----------------- | ------------------------------------------- | | src/main.ts | The base file for your Svelte Webview | | src/App.svelte | This is your webview page | | src/css/ | This folder holds all your CSS | | src/components/ | You can put all your Svelte components here |

You can put ts files that you use on the front end anywhere in the project directory EXCEPT the src/extension folder.

Back End

This is the VSCode Backend that will contain all files used by the backend.

| File / Folder | Use | | ---------------------------- | --------------------------------------------------------- | | src/extension/extension.ts | This is the base file for your extension. | | src/extension/panel.ts | This is the class that handles the creation of the Panel. | | src/extension/ | Place all utility ts files here |

Additions

VSCode-Webview-Extension-Svelte supports libraries like TailwindCSS, which you can add in the setup script.

If you want to add other popular libraries to your project, and did not do so in the setup script, go to ADDITIONS.md.

Examples

Sending data from the backend to front end

src/extension/extension.ts

import * as vscode from 'vscode';
import { SveltePanel } from './panel';

export function activate(context: vscode.ExtensionContext) {
 let disposable = vscode.commands.registerCommand('extension-name.helloWorld', () => {
  SveltePanel.render("showPanel", "Panel Name", context.extensionUri);

  SveltePanel.currentPanel?.post({
   title: "data-name",
   msg: "This is a message from the backend"
  });
 });

 context.subscriptions.push(disposable);
}

export function deactivate() {}

src/App.svelte

<script>
 window.addEventListener("message", (e) => {
  if (e.data.title === "data-name")
   console.log(e.data.msg);
 });
</script>

<p class="title">Hello, World!</p>

Contributing

Check out the contributing guidelines.

License

VSCode Webview Extension Svelte is licensed under the MIT license

Changelog

View all upcoming and previous releases here