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

@marianmeres/sveltekit-adapter-demino

v1.5.0

Published

[![NPM](https://img.shields.io/npm/v/@marianmeres/sveltekit-adapter-demino)](https://www.npmjs.com/package/@marianmeres/sveltekit-adapter-demino) [![JSR](https://jsr.io/badges/@marianmeres/sveltekit-adapter-demino)](https://jsr.io/@marianmeres/sveltekit-a

Readme

@marianmeres/sveltekit-adapter-demino

NPM JSR License

A SvelteKit adapter that outputs a Web-standard handler(req, info) function compatible with @marianmeres/demino and any Deno.ServeHandler-based server.

Install

Install the adapter as an npm dev dependency in your SvelteKit project:

npm install -D @marianmeres/sveltekit-adapter-demino

The adapter runs at build time inside Vite/Node.js. It is not installed via deno add — Deno only runs the generated handler.js at serve time.

Configure

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

export default {
  kit: {
    adapter: adapter({
      out: 'build', // default
      // Cache-Control headers for disk-served static responses.
      // All values below are defaults — override or set to `false` to disable.
      cacheControl: {
        immutable:   'public, immutable, max-age=31536000',          // /_app/immutable/*
        prerendered: 'public, max-age=600, stale-while-revalidate=86400', // prerendered pages
        assets:      'public, max-age=86400',                        // unhashed static files
      },
    }),
  },
};

Note: SSR responses are not affected by these settings — use SvelteKit's handle hook in hooks.server.ts to control caching for server-rendered routes.

Build

vite build

Output structure:

build/
├── handler.js      <- import this in your Deno server
├── client/         <- static assets + prerendered HTML (served automatically)
└── server/         <- SvelteKit SSR runtime (used internally by handler.js)

Usage in your Deno server

import { demino, deminoCompose } from 'jsr:@marianmeres/demino';
import { handler as skHandler } from './build/handler.js';

const api = demino('/api');
api.get('/hello', () => ({ hello: 'world' }));

// SvelteKit handles everything that the API doesn't
const sk = demino();
sk.all('/*', skHandler);

Deno.serve(deminoCompose([api, sk]));

Or if SvelteKit is your only app:

import { handler } from './build/handler.js';
Deno.serve(handler);

How it works

The generated handler.js:

  1. Prerendered redirects -- handles trailing-slash normalization (308 redirects) for prerendered pages, based on your SvelteKit trailingSlash config.

  2. Static files & prerendered HTML -- served from build/client/ using @std/http/file-server's serveDir. This covers everything in your static/ folder, compiled JS/CSS (/_app/...), and prerendered pages. Each response gets a Cache-Control header based on its category:

    | Category | Path pattern | Default header | |----------|-------------|----------------| | Immutable | /_app/immutable/* | public, immutable, max-age=31536000 | | Prerendered | Pages from SvelteKit's prerender list | public, max-age=600, stale-while-revalidate=86400 | | Static assets | Everything else (favicon, fonts, images…) | public, max-age=86400 |

    Override any value via cacheControl in adapter options, or set to false to skip setting the header for that category.

  3. Everything else -- forwarded to SvelteKit's SSR engine via server.respond(). This handles server routes, SSR pages, and API endpoints defined inside your SvelteKit app.

  4. Asset reading -- the handler provides a read() function to SvelteKit's server, enabling import { read } from '$app/server' for runtime asset access.

Notes

  • Deno permissions needed at runtime: --allow-net, --allow-read, --allow-env

  • The platform object available in SvelteKit hooks/endpoints will contain { info: Deno.ServeHandlerInfo }, giving you access to remoteAddr etc.

  • The adapter runs in Node.js at build time (it's a Vite plugin). The generated handler.js runs in Deno at serve time.

  • Your Deno server needs an import map for the npm packages that SvelteKit's SSR bundle references at runtime. The adapter emits build/deno-imports.json listing every bare specifier it found, each pinned to the version installed in your node_modules. Point your deno.json at it:

    // deno.json
    {
      "importMap": "./build/deno-imports.json"
    }

    Or copy its imports block into your existing deno.json imports. The file is regenerated on every build and keys are sorted alphabetically, so diffs stay clean.

    Disable emission with adapter({ denoImports: false }), or refine via adapter({ denoImports: { versionPrefix: "exact", exclude: ["tailwind-merge"], extraSpecifiers: ["some-dynamic-pkg"] } }).

    Caveats:

    • Dynamic import(someVar) with a computed string is invisible to any static scanner — use extraSpecifiers to force-add those entries.
    • A package whose exports doesn't list a subpath the SSR bundle actually imports will still error at runtime; no import map can work around that.

    Minimal manual fallback if you skip the generated file entirely:

    { "imports": { "@sveltejs/kit": "npm:@sveltejs/kit@^2.0.0" } }

License

MIT