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

msw-panel

v0.2.2

Published

Devtools panel for Mock Service Worker — inspect and toggle handlers during development

Readme

msw-panel

Framework-agnostic devtools for Mock Service Worker. Inspect registered handlers and toggle them on or off during development — without replacing your existing MSW setup.

Install

npm install -D msw-panel

Note: msw-panel expects MSW 2.x to already be installed in your project as a peer dependency.

Quick start

import { createMswPanelController } from "msw-panel";
import { MswPanel } from "msw-panel/react";
import { worker } from "./mocks/browser";

const controller = createMswPanelController({ runtime: worker });

export function App() {
  return (
    <>
      <YourApp />
      <MswPanel controller={controller} />
    </>
  );
}

controller accepts null, so no ternary is needed when the controller is conditionally created:

const controller = import.meta.env.DEV ? createMswPanelController({ runtime: worker }) : null;

<MswPanel controller={controller} />;

To start with every handler disabled until a user enables specific ones:

const controller = createMswPanelController({
  runtime: worker,
  defaultEnabled: false,
});

Embedded panel

Use MswPanelEmbedded to render the panel inline — useful in Storybook addons or custom dev toolbars:

import { MswPanelEmbedded } from "msw-panel/react";

<MswPanelEmbedded controller={controller} style={{ height: "500px" }} />;

Options

| Prop / option | Default | Description | | ------------------ | ---------------- | -------------------------------------------------------------------- | | controller | — | Required. Pass null to render nothing. | | defaultOpen | false | Open the panel on first render. | | panelSide | inferred | Which side of the trigger button the panel expands toward. | | position | "bottom-right" | Viewport corner for the floating trigger button. | | shadow | false | Render inside a Shadow DOM root to isolate from external CSS resets. | | showInProduction | false | Render in production too. Intended for hosted demos and docs only. | | showCount | true | Show the enabled-handler count badge on the trigger button. | | showSync | false | Show the Sync button (only needed when adding handlers dynamically). | | theme | "dark" | "dark" or "light". | | title | "MSW Panel" | Heading shown inside the open panel. |

Controller API

const controller = createMswPanelController({ runtime });

controller.getSnapshot(); // current handler state
controller.toggle(id); // toggle one handler
controller.setEnabled(id, false); // enable/disable one handler
controller.setAllEnabled(false); // enable/disable all
controller.sync(); // re-read handlers from the runtime
controller.subscribe(listener); // subscribe to changes, returns unsubscribe

Remote inspector

Use msw-panel/bridge to connect a panel in a separate window or process:

import {
  createMswPanelBridgeClient,
  createMswPanelBridgeServer,
  createBroadcastChannelMswPanelBridgeTransport,
} from "msw-panel/bridge";

// In the host app (where MSW runs)
const transport = createBroadcastChannelMswPanelBridgeTransport("msw-panel");
createMswPanelBridgeServer({ controller, transport });

// In the inspector app (separate window/frame)
const transport = createBroadcastChannelMswPanelBridgeTransport("msw-panel");
const remoteController = createMswPanelBridgeClient({ transport });
<MswPanel controller={remoteController} />

Other transports: createPostMessageMswPanelBridgeTransport, createWebSocketMswPanelBridgeTransport.

Documentation

Full docs at barrymichaeldoyle.github.io/msw-panel · Live demo.