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

@openworkers/adapter-sveltekit

v0.5.6

Published

SvelteKit adapter for OpenWorkers

Readme

@openworkers/adapter-sveltekit

SvelteKit adapter for OpenWorkers.

Installation

bun add -d @openworkers/adapter-sveltekit

Usage

// svelte.config.js
import adapter from '@openworkers/adapter-sveltekit';

export default {
  kit: {
    adapter: adapter({
      outDir: 'build', // Output directory (default: 'build')
      functions: true // Generate mini-workers for API routes (default: false)
    })
  }
};

Options

| Option | Type | Default | Description | | ------------ | --------- | --------- | ------------------------------------------------- | | outDir | string | 'build' | Output directory for the build | | functions | boolean | false | Generate separate mini-workers for each API route | | nodeCompat | boolean | false | Include shims for Node.js built-in modules |

Output

build/
├── _worker.js     # Main SSR worker
├── _routes.json   # Route manifest for edge routing
├── assets/        # Static assets and prerendered pages
└── functions/     # Mini-workers for API routes (if functions: true)
    ├── api-hello.js
    └── api-users.js

Functions Mode

When functions: true, the adapter generates a separate mini-worker for each +server.ts endpoint:

  • /api/hello/+server.tsfunctions/api-hello.js
  • /api/users/+server.tsfunctions/api-users.js

The route mappings are included in _routes.json:

{
  "functions": [
    { "pattern": "/api/hello", "worker": "functions/api-hello.js" },
    { "pattern": "/api/users", "worker": "functions/api-users.js" }
  ]
}

This prepares for native project routing in the OpenWorkers runner, where each function can be deployed as a separate worker for better isolation and scaling.

TypeScript

For proper types on platform.env, add @openworkers/workers-types:

bun add -d @openworkers/workers-types

Then in src/app.d.ts:

/// <reference types="@openworkers/workers-types" />

declare global {
  namespace App {
    interface Platform {
      env: {
        KV: BindingKV;
        ASSETS: BindingAssets;
      };
    }
  }
}

export {};

Deployment

Build your SvelteKit app, then deploy it with the OpenWorkers CLI:

# Build
bun run build

# Deploy
ow workers upload my-app ./build

For a first deployment, you'll need to set up the worker and its assets binding:

# Create the worker
ow workers create my-app -d "My SvelteKit App"

# Create a storage bucket for static assets
ow storage create my-storage

# Create an environment and bind the storage as ASSETS
ow env create my-app-env
ow env bind my-app-env ASSETS my-storage --type assets

# Link the environment to the worker
ow workers link my-app my-app-env
# Build and upload
bun run build
ow workers upload my-app ./build

Examples

License

MIT