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

served-hot

v0.1.4

Published

Server-side hot-reloading for Express

Readme


served-hot brings the hot-reloading you know and love from the client-side to Express servers. It can greatly improve your development experience across the entire stack.

It's not a pure drop-in solution (yet), and your mileage may vary depending on how you've set up your Express server. Nevertheless, this documentation will walk you through the setup and configuration it was built to function with.

Additionally, the code behind served-hot is quite simple, and I encourage you to dig in and steal it as necessary in order to suit your specific needs.


Table of Contents

Features

  • Vastly improves your developer experience
  • Only watches your server-side files (via Chokidar)

Documentation

Install

npm install served-hot

Configuration

served-hot expects that your server-side routing, or API, is served under a root path, such as /api.

It also expects your server to have a root router file, which is a module that exports an Express router that all of your routes are defined on.

For example, let's say you have a server entry point at src/index.js that starts an Express server:

const express = require('express');
const api = require('./api');

const app = express();

// The "/api" path is defined as the root path for all server-side routing
app.use('/api', api);

app.listen(8080);

And you also have a file at src/api.js that exports your root router:

const Router = require('express').Router;
const router = Router();

router.get('/users', (req, res) => {
  res.json(['list', 'of', 'users']);
});

router.post('/hello', (req, res) => {
  res.json({ data: 'world' });
});

module.exports = router;

With the above configuration, your Express server configuration is kept separate from your route definitions, which is generally considered a good practice even outside of using served-hot.

Using the above configuration, to enable hot-reloading for all of your Express routes, modify your src/index.js to use served-hot:

const express = require('express');
const hot = require('served-hot');

const app = express();

hot(app, {
  // Tell served-hot that "/api" is your root path
  rootPath: '/api',
  // Tell served-hot where your root router file is
  routerPath: './api',
  // Tell served-hot which directory to watch for file changes
  watchPath: './',
});

app.listen(8080);

Alternatively, you'll probably want to do this based on the environment, for example:

const express = require('express');
const hot = require('served-hot');
const api = require('./api');

const app = express();
const env = process.env.NODE_ENV;

if (env === 'production') {
  app.use('/api', api);
} else {
  hot(app, {
    rootPath: '/api',
    routerPath: './api',
    watchPath: './',
  });
}

app.listen(8080);

FAQ

Coming soon...

Credits