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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@goauthentik/esbuild-plugin-live-reload

v1.3.1

Published

ESBuild + browser refresh. Build completes, page reloads.

Readme

ESBuild Plugin Live Reload


An ESBuild development plugin that watches for file changes and triggers automatic browser refreshes.

Quick start

npm install -D @goauthentik/esbuild-plugin-live-reload
# Or with Yarn:
yarn add -D @goauthentik/esbuild-plugin-live-reload

1. Configure ESBuild

import { liveReloadPlugin } from "@goauthentik/esbuild-plugin-live-reload";

import esbuild from "esbuild";

const NodeEnvironment = process.env.NODE_ENV || "development";

/**
 * @type {esbuild.BuildOptions}
 */
const buildOptions = {
    // ... Your build options.
    define: {
        "process.env.NODE_ENV": JSON.stringify(NodeEnvironment),
    },
    plugins: [
        /** @see {@link LiveReloadPluginOptions} */
        liveReloadPlugin(),
    ],
};

const buildContext = await esbuild.context(buildOptions);

await buildContext.rebuild();
await buildContext.watch();

2. Connect your browser

Add the following import near the beginning of your application's entry point.

if (process.env.NODE_ENV === "development") {
    await import("@goauthentik/esbuild-plugin-live-reload/client");
}

That's it! Your browser will now automatically refresh whenever ESBuild finishes rebuilding your code.

About authentik

authentik is an open source Identity Provider that unifies your identity needs into a single platform, replacing Okta, Active Directory, and Auth0.

We built this plugin to streamline our development workflow, and we're sharing it with the community. If you have any questions, feature requests, or bug reports, please open an issue.

License

This code is licensed under the MIT License

Plugin API

EventServerInit

Properties

| Property | Type | | ------------------------------------ | ---------------------------------------------------------------------- | | dispatcher | EventTarget | | logger? | Pick<BaseLogger, "warn" | "error" | "debug" | "info"> | | pathname | string |


LiveReloadPluginOptions

Properties

| Property | Type | Description | | ------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | | listenOptions? | ListenOptions | Options for the server's listen method. | | logger? | Pick<BaseLogger, "warn" | "error" | "debug" | "info"> | A console-like logger. | | publicURL? | string | URL | A URL to listen on. If not provided, a random port will be used. | | relativeRoot? | string | A relative path to the root of the project. This is used to resolve build errors, line numbers, and file paths. | | server? | Server<typeof IncomingMessage, typeof ServerResponse> | Server<typeof IncomingMessage, typeof ServerResponse> | A server to listen on. If not provided, a new server will be created. |


RequestHandler()

RequestHandler<> = (req, res) => void

Type Parameters

| Type Parameter | | -------------- |

Parameters

| Parameter | Type | | --------- | ---------------------- | | req | http.IncomingMessage | | res | http.ServerResponse |

Returns

void


liveReloadPlugin()

liveReloadPlugin(options?): Plugin

Creates a plugin that listens for build events and sends them to a server-sent event stream.

Parameters

| Parameter | Type | Description | | ---------- | ----------------------------------------------------- | ----------- | | options? | LiveReloadPluginOptions | |

Returns

Plugin


default

Renames and re-exports liveReloadPlugin

Server API

createRequestHandler()

createRequestHandler(options): RequestHandler

Create an event request handler.

Parameters

| Parameter | Type | Description | | --------- | ------------------------------------- | ----------- | | options | EventServerInit | |

Returns

RequestHandler

Runtime

node