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

@juddroid_raccoon/msw-devtools-react

v0.1.1

Published

React adapter for @juddroid_raccoon/msw-devtools-core. Provider + hook, SSR-safe, Next.js compatible.

Readme

@juddroid_raccoon/msw-devtools-react

React adapter for @juddroid_raccoon/msw-devtools-core. Visual devtools for toggling MSW handlers at runtime — <MswDevtools> component + useMswDevtools() hook, SSR-safe, 'use client'-tagged for Next.js App Router.

screenshot

Install

pnpm add -D @juddroid_raccoon/msw-devtools-react msw

You also need MSW's service worker file in public/:

pnpm dlx msw init public/ --save

Quick start

'use client';
import { MswDevtools } from '@juddroid_raccoon/msw-devtools-react';
import { handlers } from './mocks/handlers';

export function Providers({ children }: { children: React.ReactNode }) {
  return (
    <MswDevtools
      handlers={handlers}
      enabled={process.env.NODE_ENV !== 'production'}
    >
      {children}
    </MswDevtools>
  );
}

A FAB appears in the bottom-right corner. Click it to open the drawer and toggle individual handlers.

Features

  • <MswDevtools> single component — wraps your tree, mounts UI, provides context
  • enabled prop — flip to false in production; component returns its children with zero side effects
  • useMswDevtools() hook — reactive enabledKeys, toggle, isEnabled, notifyUnhandledRequest
  • Concurrency-safe — uses useSyncExternalStore (React 18+)
  • Next.js compatible'use client' banner preserved in published bundles, SSR snapshot safe
  • Dark-first UI + light/auto themes, persistent state, URL-shareable presets, no global side effects

With axios + react-query

'use client';
import { useEffect } from 'react';
import { MswDevtools, useMswDevtools } from '@juddroid_raccoon/msw-devtools-react';
import { QueryClient, QueryClientProvider, useQueryClient } from '@tanstack/react-query';
import axios from 'axios';
import { handlers } from './mocks/handlers';

function AxiosBridge() {
  const { notifyUnhandledRequest } = useMswDevtools();
  useEffect(() => {
    const id = axios.interceptors.response.use(undefined, (err) => {
      notifyUnhandledRequest({
        method: err.config?.method ?? '',
        url: (err.config?.baseURL ?? '') + (err.config?.url ?? ''),
      });
      throw err;
    });
    return () => axios.interceptors.response.eject(id);
  }, [notifyUnhandledRequest]);
  return null;
}

function Inner() {
  const queryClient = useQueryClient();
  return (
    <MswDevtools
      handlers={handlers}
      onMockChange={() => queryClient.refetchQueries({ type: 'all' })}
    >
      <AxiosBridge />
      {/* your app */}
    </MswDevtools>
  );
}

export default function App() {
  const [client] = useState(() => new QueryClient());
  return (
    <QueryClientProvider client={client}>
      <Inner />
    </QueryClientProvider>
  );
}

Next.js App Router

// app/providers.tsx
'use client';
import { MswDevtools } from '@juddroid_raccoon/msw-devtools-react';
import { handlers } from '@/mocks/handlers';

export function Providers({ children }: { children: React.ReactNode }) {
  return (
    <MswDevtools
      handlers={handlers}
      enabled={process.env.NODE_ENV !== 'production'}
    >
      {children}
    </MswDevtools>
  );
}
// app/layout.tsx (server component is fine — Providers is the 'use client' boundary)
import { Providers } from './providers';

export default function RootLayout({ children }: { children: React.ReactNode }) {
  return (
    <html lang="en">
      <body><Providers>{children}</Providers></body>
    </html>
  );
}

Common props

<MswDevtools
  handlers={handlers}                                  // required
  enabled={process.env.NODE_ENV !== 'production'}      // production gate (default true)
  baseUrl="https://api.example.com"
  groupBy={(path) => (path.startsWith('/admin') ? 'Admin' : 'Other')}
  defaultEnabled={['GET::/me']}
  storageKey="my-app-msw"
  position="bottom-right"
  theme="auto"                                          // 'light' | 'dark' | 'auto'
  onMockChange={(keys) => queryClient.refetchQueries({ type: 'all' })}
  onReset={() => window.dispatchEvent(new Event('app:error-boundary-reset'))}
>
  {children}
</MswDevtools>

API

See the GitHub repo for the full API reference, design notes, and runnable examples (vanilla, Vite + React, Next.js App Router).

License

MIT © 2026 Raccoon