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

@fr0/player

v0.1.0

Published

React preview component with playback controls

Readme

@fr0/player

React preview component with playback controls.

Status

✅ Phase α-2 — done

Purpose

A zero-config preview component: pass a Timeline and get a scrubbable preview with play / pause / seek controls. Internally composes @fr0/renderer-browser's <TimelineRenderer> with a RAF-driven playback state machine (usePlayback).

For custom UIs, skip <Player> and build against the usePlayback hook directly.

Quick start

import { Player } from '@fr0/player';
import { buildSample } from '@fr0/templates';

const timeline = buildSample('titleCard', { title: 'Hello, world!' });

export function App() {
  return <Player timeline={timeline} autoPlay loop />;
}

Public API

| Export | Purpose | |---|---| | <Player> | Drop-in preview that composes usePlayback + <TimelineRenderer> + optional <PlaybackControls>. Props: timeline, autoPlay, loop, initialFrame, registry, controls, style, className. | | usePlayback({ timeline, autoPlay, loop, initialFrame }) | Hook returning { frame, isPlaying, play, pause, toggle, seek, reset }. The state machine behind <Player>, exposed for custom UIs. | | <PlaybackControls> | Presentational strip with a play / pause button, scrubber slider, and frame / total counter. Wires user input to supplied callbacks. |

Design notes

  • Real-time playback. The RAF loop tracks performance.now() deltas and divides by 1000/fps to compute the frame delta, so slow hosts drop frames rather than slipping out of sync with wall-clock time.
  • Mutable refs inside usePlayback mirror the latest props and state so the RAF callback never reads stale closures. The effect re-subscribes only on isPlaying transitions.
  • Loop handling. At the final frame, the hook either wraps to 0 (loop: true, default) or pauses (loop: false).
  • Seek floors and clamps the target into [0, totalFrames - 1] and resets the internal clock so playback resumes smoothly from the new position.
  • Frame accuracy is not guaranteed. This is a preview tool, not a deterministic exporter. Server-side / encoder paths (Phase β, γ) drive the frame counter externally instead of via RAF.

Testing

pnpm --filter @fr0/player test

15 tests across 3 files. requestAnimationFrame and performance.now are mocked with vi.stubGlobal so playback is driven deterministically without fighting fake timers + React scheduling.

What this package is NOT