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

@forgedock/fd-fastest-runtime-next

v1.0.0

Published

Client-side performance instrumentation for Next.js App Router

Readme

@fd-fastest/runtime-next

Client-side performance instrumentation for Next.js App Router applications.

Features

  • 🎯 Web Vitals with Attribution: LCP, CLS, INP with detailed diagnostics
  • ⏱️ Long Task Detection: Capture tasks blocking the main thread
  • 🔄 Route Change Tracking: Automatic marks for navigation events
  • 💧 Hydration Timing: Measure React hydration performance
  • 📊 Zero Configuration: Drop-in component, works out of the box
  • 🪶 Minimal Overhead: < 5KB gzipped, non-blocking collection

Installation

pnpm add @fd-fastest/runtime-next

Usage

Basic Setup

Add the <FDFastMarks /> component to your root layout:

// app/layout.tsx
import { FDFastMarks } from '@fd-fastest/runtime-next';

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

That's it! The component will automatically collect metrics in the background.

Accessing Collected Data

Data is stored in window.__fdfast.buffer:

// In your browser console or test scripts
import { createLogger } from '@fd-fastest/logger';

const logger = createLogger({ name: 'runtime-buffer' });

logger.debug('Buffered entries', window.__fdfast.buffer);

// Example output:
// [
//   { type: 'lcp', metric: { value: 2400, rating: 'good', ... } },
//   { type: 'cls', metric: { value: 0.05, rating: 'good', ... } },
//   { type: 'longtask', s: 1000, d: 120 },
//   ...
// ]

TypeScript Support

import type {
  LCPEntry,
  CLSEntry,
  AnyBufferEntry,
} from '@fd-fastest/runtime-next';

// Type-safe buffer access
const lcpEntries = window.__fdfast?.buffer.filter(
  (entry): entry is LCPEntry => entry.type === 'lcp'
);

How It Works

Performance Marks

The component creates performance marks for:

  • fd-fastest:route:[pathname]:start - When route navigation begins
  • fd-fastest:route:[pathname]:end - When component unmounts
  • fd-fastest:first-paint:approx - Approximate first paint time
  • fd-fastest:hydration:end - When React hydration completes

Web Vitals Collection

Uses web-vitals/attribution for detailed diagnostics:

  • LCP: Captures element, URL, TTFB, resource delays
  • CLS: Identifies largest shift target and value
  • INP: Tracks interaction target, type, and timing breakdown

Long Task Detection

Uses PerformanceObserver to capture tasks > 50ms that block the main thread.

API Reference

FDFastMarks Component

<FDFastMarks />

No props required. Automatically tracks the current route using Next.js hooks.

Types

interface Window {
  __fdfast?: {
    buffer: AnyBufferEntry[];
    version: string;
  };
}

type AnyBufferEntry =
  | LCPEntry
  | CLSEntry
  | INPEntry
  | LongTaskEntry
  | MarkEntry
  | MeasureEntry;

Browser Support

  • Modern Browsers: Chrome, Edge, Firefox, Safari (latest 2 versions)
  • Long Tasks: Chrome, Edge (PerformanceObserver)
  • Web Vitals: All modern browsers

Falls back gracefully if APIs are not available.

Development

# Build package
pnpm build

# Watch mode
pnpm dev

# Run tests
pnpm test

# Type check
pnpm typecheck

License

MIT