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-static

v0.1.5

Published

Static site adapter for OpenWorkers

Readme

@openworkers/adapter-static

Static site adapter for OpenWorkers. Converts any static site into a deployable worker with optimized asset serving.

Installation

bun add -g @openworkers/adapter-static

Quick Start

# Auto-detect input folder and generate worker
adapter-static

# Specify input and output directories
adapter-static ./build -o ./dist

# Custom 404 page
adapter-static --fallback /404.html

CLI Options

| Option | Flag | Default | Description | | --------- | ---------------- | ------------------ | --------------------------------------------------- | | Input | positional | auto-detect | Source directory (dist, build, out, public) | | Output | -o, --out | dist-openworkers | Output directory | | Mode | -m, --mode | auto-detect | Routing mode: directory or flat | | Fallback | -f, --fallback | none | Fallback file for unmatched routes | | Immutable | --immutable | auto-detect | Comma-separated immutable path patterns |

Programmatic Usage

import { adapt } from '@openworkers/adapter-static';

await adapt({
  input: 'build',
  out: 'dist',
  mode: 'flat',
  fallback: '/404.html'
});

Output Structure

dist/
├── _worker.js     # Worker serving files via ASSETS binding
├── _routes.json   # Route manifest for edge routing
└── assets/        # Static files

Routing Modes

The adapter auto-detects the routing mode based on your file structure.

| Mode | URL | File | | ------------- | -------- | ------------------- | | Directory | /about | /about/index.html | | Flat | /about | /about.html |

Directory mode is used by most static generators. Flat mode is common with SvelteKit static adapter.

Immutable Assets

Assets with hashed filenames are served with long cache headers (max-age=31536000, immutable).

Auto-detected patterns:

  • /_app/immutable/* — SvelteKit
  • /assets/* — Vite
  • /_next/static/* — Next.js
  • /_astro/* — Astro

Deploy to OpenWorkers

Quick deploy (existing worker):

ow workers upload my-site ./dist

Full setup:

# 1. Create storage for assets
ow storage create my-site-assets --provider platform

# 2. Create environment
ow env create my-site-env

# 3. Bind storage to environment as ASSETS
ow env bind my-site-env ASSETS my-site-assets -t assets

# 4. Create worker
ow workers create my-site

# 5. Link environment to worker
ow workers link my-site my-site-env

# 6. Build and upload
adapter-static ./build -o ./dist
ow workers upload my-site ./dist

Your site is live at https://my-site.workers.rocks

License

MIT