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

svelte-adapter-nitro

v0.0.7

Published

A SvelteKit adapter powered by Nitro.

Readme

svelte-adapter-nitro

npm version npm downloads License Node.js

A SvelteKit adapter powered by Nitro.

Deploy your SvelteKit applications across any platform supported by Nitro—including Node.js, Vercel, Cloudflare, Netlify, AWS Lambda, Bun, Deno, and more.

Installation

npm install -D svelte-adapter-nitro nitro
# or
pnpm add -D svelte-adapter-nitro nitro
# or
bun add -d svelte-adapter-nitro nitro

Note: nitro and @sveltejs/kit are required peer dependencies.

Usage

Configure the adapter in vite.config.ts:

import { sveltekit } from "@sveltejs/kit/vite";
import adapter from "svelte-adapter-nitro";
import { defineConfig } from "vite";

export default defineConfig({
  plugins: [
    sveltekit({
      adapter: adapter({
        preset: "node-server",
      }),
    }),
  ],
});

Or in svelte.config.js:

import adapter from "svelte-adapter-nitro";

/** @type {import('@sveltejs/kit').Config} */
const config = {
  kit: {
    adapter: adapter({
      preset: "node-server",
    }),
  },
};

export default config;

Options

| Option | Type | Default | Description | | ------------- | ---------------------------- | --------------- | -------------------------------------------------------------------------------------------------------------- | | preset | NitroConfig["preset"] | 'node-server' | Target deployment preset for Nitro (e.g. 'vercel', 'cloudflare-pages', 'aws-lambda', 'bun', 'deno'). | | out | string | 'dist' | Output directory for the build. | | precompress | boolean \| CompressOptions | false | Enable pre-compression of public assets and prerendered routes (gzip, brotli, zstd). | | minify | boolean | true | Minify the server bundle output. | | sourcemap | boolean | true | Generate sourcemaps for the server build. | | trustProxy | boolean | true | Trust X-Forwarded-For proxy headers for event.getClientAddress(). | | nitro | NitroConfig | {} | Additional Nitro options passed directly to the Nitro engine. |

Bundling Native Production Dependencies

If your application relies on native production dependencies (e.g., C/C++ native modules like sharp, canvas, database drivers, or Prisma) or you need external packages traced and bundled into the production output, pass Nitro's traceDeps array via nitro:

adapter({
  preset: "node-server",
  nitro: {
    // Trace specific packages into the build output
    traceDeps: ["sharp", "prisma*"],
  },
});

traceDeps supports:

  • Full package trace syntax using wildcards (e.g. 'pkg*').
  • Exclusions using a leading exclamation mark (e.g. '!pkg').
  • Regular expressions (e.g. /^@prisma\//).

Running Code on Shutdown

If your application needs to execute code when the Nitro server shuts down, define a Nitro plugin and register a close hook. For example, create src/nitro/cleanup.ts:

import { definePlugin } from "nitro";

export default definePlugin((nitroApp) => {
  nitroApp.hooks.hook("close", async () => {
    // Close database connections, stop timers, flush telemetry, etc.
  });
});

Register the plugin through the adapter's nitro options:

adapter({
  preset: "node-server",
  nitro: {
    plugins: ["./src/nitro/cleanup.ts"],
  },
});

The close hook runs during a graceful Nitro shutdown. See the Nitro lifecycle documentation for available hooks and deployment-specific behavior.

License

MIT