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

@deboxsoft/bytemd-sveltekit

v2.0.0

Published

A barebones project that provides the essentials for writing highly-optimized, reusable packages in Svelte using SvelteKit's [`package`](https://kit.svelte.dev/docs#packaging) feature.

Readme

sveltekit-package-template

A barebones project that provides the essentials for writing highly-optimized, reusable packages in Svelte using SvelteKit's package feature.

All styles are component-scoped and preprocessed into minified and prefixed CSS during packaging using cssnano and autoprefixer. TypeScript type definitions are generated automatically from your components using svelte2tsx.

The Problem

One of Svelte's largest pitfalls currently is it's ecosystem. Compared to more mainstream frameworks, it's userland is tiny in comparison to the thousands of available components on npm. While popularity is a large contribution to this, lack of documentation and resources is also a problem.

Many packages at the moment have some sort of pitfall. Some require bundling a large stylesheet for the entire library just to use a single component. Others require developers using it to setup a package such as svelte-preprocess because they use TypeScript internally. Most of all, there really just isn't much information out there on library authoring. What many don't realize is that all of these aformentioned pitfalls can be worked around.

While svelte does offer an official component template, it lacks many features required for a production-ready package (typescript, preprocessing, styling conventions).

Getting Started

These commands will set you up with a SvelteKit development environment:

npx degit tropix126/sveltekit-package-template my-package
cd my-package
npm install # or pnpm, yarn, etc...
npm run dev

From there, you can edit the example Counter component in src/lib/Counter/Counter.svelte.

The index.ts file in src/lib exports your components for use in the package.

Packaging and Publishing

Packaging

To package your components, simply run the package command:

npm run package

This will preprocess the contents of src/lib into a package folder at the root of your project.

Publishing to NPM

After you have generated the package folder, run npm publish ./package to publish your library to NPM.

Be sure to properly configure package.json with the correct data before publishing.

Routes

Since the package command only generates it's files from src/lib, you are free to put whatever you wish in the routes folder. This could be used as a documentation site for your component, as an example.

Using your Package

Consumers of your package can import components from it in external projects like so:

<script>
    import { Component } from "my-package";
</script>

<Component />

Setting up Documentation

Most components will need documentation in some form. This template doesn't have any opinions on how documentation should be handled, however it does provide you with SvelteKit's routes folder which can be used for this. Below are some very useful svelte-focused tools that can make your life considerably easier when documenting components:

  • vite-plugin-svled is a vite port of sveld, which allows you to automatically generate API documentation for your svelte components using typescript types and JSDoc comments.
  • mdsvex is a superset of markdown that allows the usage of Svelte components and interactive logic. Since mdsvex preprocesses your markdown files into Svelte components, it can also be used as SvelteKit routes.
  • mdsvex-sveld is an mdsvex plugin that automatically outputs markdown tables for component API documentation using sveld.

Setting up Theming

If you plan to develop a large amount of components, it may become necessary to have people import a theme stylesheet containing variables. This can be done by creating a theme.css file in src/lib and having people import it from node_modules.

Developers using your library could import the theme file like so:

<script>
    import "my-package/theme.css";
    import { ComponentThatUsesTheming } from "my-package";
</script>

<ComponentThatUsesTheming />

Many modern bundlers support importing CSS as ES Modules. This is likely to be the best way of importing theme files, as they can be easily resolved from node_modules. Alternatively, you can use @import syntax with the postcss-import plugin or sass in your <style> tags, or consider CDNS such as unpkg.