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

@peterddod/phop

v1.2.0

Published

Peer-to-peer state management for React using WebRTC. Share and sync state across browsers in real time — no backend required.

Readme

phop

Peer-to-peer state management for React using WebRTC. Share and sync state across browsers in real time — no backend required.

⚠️ Early Development — P2P synchronization features are under active development

Installation

npm install @peterddod/phop

Usage

Wrap your app in a <Room> provider and connect to a signaling server:

import { Room, useRoom, useSharedState } from '@peterddod/phop';

function App() {
  return (
    <Room signallingServerUrl="wss://your-signalling-server" roomId="my-room">
      <Counter />
    </Room>
  );
}

function Counter() {
  const [count, setCount] = useSharedState('count', 0);

  return (
    <button onClick={() => setCount(count + 1)}>
      Count: {count}
    </button>
  );
}

State updates in useSharedState are automatically broadcast to all peers in the room and merged using a configurable conflict resolution strategy.

API

<Room>

Establishes a WebRTC mesh with all peers in the given room.

| Prop | Type | Description | |------|------|-------------| | signallingServerUrl | string | WebSocket URL of the signaling server | | roomId | string | Room identifier — peers sharing a room ID connect to each other |

useSharedState(key, initialValue, options?)

Shared state hook — works like useState but syncs across all peers in the room.

const [value, setValue] = useSharedState<T>(key: string, initialValue: T, options?: {
  mergeStrategy?: MergeStrategy; // default: lastWriteWins
})

useRoom()

Access room metadata and low-level messaging.

const { peerId, peers, isConnected, broadcast, onMessage } = useRoom();

Signaling Server

phop requires a lightweight signaling server to coordinate the initial WebRTC handshake. Once peers are connected, all state sync happens directly between browsers.

A production-ready server is available as a Docker image:

docker run -p 8080:8080 ghcr.io/peterddod/phop/signalling-server:latest

Source and self-hosting instructions: packages/signalling-server

License

MIT © Peter Dodd