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

@turbo-mock/request-tracker

v0.1.1

Published

A React component for tracking and inspecting network requests using a service worker

Readme

@turbo-mock/request-tracker

A React component for tracking and inspecting network requests in real-time using a service worker.

Installation

Step 1: Install the package

npm install @turbo-mock/request-tracker

The service worker file (sw.js) is automatically copied to your app's public folder during installation via the postinstall script.

Step 2: Verify service worker installation

After installation, check that sw.js exists in your public folder:

ls public/sw.js

Step 3: Manual installation (if needed)

If the automatic installation didn't work or you need to reinstall the service worker, you can run:

Option 1: Using npx (recommended)

npx -p @turbo-mock/request-tracker install-sw

Option 2: Using npm script

npm run install-sw --prefix node_modules/@turbo-mock/request-tracker

Option 3: From the package directory

cd node_modules/@turbo-mock/request-tracker
npm run install-sw

Features

  • 🎯 Track all network requests (fetch/XHR)
  • 🔍 Filter requests by domain and HTTP method
  • 📊 View request/response details
  • 💾 Download request data as JSON
  • 🎨 Floating UI panel with customizable position
  • ⚡ Automatic service worker setup via postinstall script

Usage

import { RequestTracker } from '@turbo-mock/request-tracker';
import '@turbo-mock/request-tracker/style.css';

function App() {
  return (
    <div>
      <h1>My App</h1>
      <RequestTracker />
    </div>
  );
}

Service Worker Setup

The service worker (sw.js) is required for the component to function. It intercepts network requests and sends them to the React component for display.

Automatic Setup

The service worker is automatically installed to your public folder when you run npm install. This happens via the postinstall script.

Manual Setup

If you need to manually install or reinstall the service worker:

Option 1: Using npx (recommended)

npx -p @turbo-mock/request-tracker install-sw

Option 2: Using npm script

npm run install-sw --prefix node_modules/@turbo-mock/request-tracker

Option 3: Direct copy

cp node_modules/@turbo-mock/request-tracker/dist/sw.js public/sw.js

Note: Make sure your public folder exists before running the installation script.

Components

RequestTracker

A floating button that opens a panel to view and filter network requests.

Props:

  • externalServiceWorkerPath?: string - Custom path to service worker (default: '/sw.js')
  • maxRequests?: number - Maximum number of requests to keep in memory (default: 100)
  • position?: 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left' - Panel position (default: 'bottom-right')

Example:

<RequestTracker 
  maxRequests={50}
  position="top-right"
  externalServiceWorkerPath="/custom-sw.js"
/>

Hook

useFetchTrackerRegistration

Custom hook for managing service worker registration and request tracking.

import { useFetchTrackerRegistration } from '@turbo-mock/request-tracker';

function MyComponent() {
  const {
    requests,
    filteredRequests,
    clearRequests,
    downloadRequests,
    // ... other utilities
  } = useFetchTrackerRegistration({
    maxRequests: 100,
    position: 'bottom-right'
  });

  // Use the hook data...
}