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

@exortek/remix-fastify

v2.0.0

Published

Fastify plugin for React Router v7 / Remix

Downloads

56

Readme

@exortek/remix-fastify

Fastify plugin for React Router v7 / Remix v2.

Handles the Vite dev server in development and static asset serving in production — you bring your own Fastify instance.

Compatibility

| Package | React Router | Remix | Fastify | |---------|:------------:|:-----:|:-------:| | ^2.x | ^7.x | ^2.x | ^5.x |

Installation

React Router v7

npm install @exortek/remix-fastify @react-router/node react-router react react-dom

or

yarn add @exortek/remix-fastify @react-router/node react-router react react-dom

Remix v2

npm install @exortek/remix-fastify @remix-run/node @remix-run/server-runtime react react-dom

or

yarn add @exortek/remix-fastify @remix-run/node @remix-run/server-runtime react react-dom

Usage

// server.mjs
import fastify from 'fastify';
import remixFastify from '@exortek/remix-fastify';

const app = fastify({ logger: true });

app.register(remixFastify,{ mode: process.env.NODE_ENV });

app.listen({ port: 3000 });

With load context

app.register(remixFastify,{
    mode: process.env.NODE_ENV,
    getLoadContext: (request, reply) => ({
        db: dbClient,
        user: request.user,
    }),
});

TypeScript

import fastify from 'fastify';
import remixFastify from '@exortek/remix-fastify';
import type { RemixFastifyOptions } from '@exortek/remix-fastify';

const app = fastify();

const options: RemixFastifyOptions = {
  mode: process.env.NODE_ENV,
  getLoadContext: async (request, reply) => ({
    db: dbClient,
  }),
};

app.register(remixFastify, options);

app.listen({ port: 3000 });

How it works

  • Development — mounts the Vite dev server as middleware (middlewareMode: true) with HMR via virtual:react-router/server-build.
  • Production — serves static assets from build/client via @fastify/static, then routes all requests through React Router / Remix.

Fastify's built-in body parsers are disabled for the React Router handler so the raw request stream stays intact for body parsing.

Options

| Option | Type | Default | Description | |--------|------|---------|-------------| | buildDirectory | string | 'build' | Root build output directory | | clientDirectory | string | 'client' | Client assets sub-directory | | serverDirectory | string | 'server' | Server build sub-directory | | serverBuildFile | string | 'index.js' | Server entry filename | | mode | string | NODE_ENV | 'development' or 'production' | | getLoadContext | Function | undefined | Returns React Router AppLoadContext passed to loaders/actions | | fastifyStaticOptions | object | {} | Options forwarded to @fastify/static (production only) | | viteOptions | object | {} | Options forwarded to Vite dev server (development only) |

getLoadContext

Use getLoadContext to pass server-side data (database clients, auth info, environment variables, etc.) into your route loaders and actions via the context parameter.

// server.mjs
app.register(remixFastify,{
    getLoadContext: (request, reply) => ({
        db: dbClient,
        env: process.env,
    }),
});

// routes/dashboard.tsx
export async function loader({ context }) {
  const posts = await context.db.query('SELECT * FROM posts');
  return { posts };
}

License

MIT