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

@flatscout/browser-bridge

v1.0.0

Published

Server-side WebSocket bridge that lets a paired Flatscout browser extension proxy HTTPS requests from the user's real Chrome/Firefox session into the Flatscout agent.

Readme

@flatscout/browser-bridge

Server-side WebSocket bridge that lets a paired Flatscout browser extension proxy HTTPS requests from the user's real Chrome/Firefox session into the Flatscout agent.

The point of the bridge: source plugins that target DataDome/Cloudflare-protected hosts (Homegate, ImmoScout24) call BrowserBridgeTransport.request(...); the request is forwarded to the connected extension, which runs fetch() inside a hidden tab loaded at the target's homepage via chrome.scripting.executeScript({ world: 'MAIN' }). The page's own DataDome-hooked window.fetch signs the request, so the upstream sees a legitimate web-app call. The response is shipped back over the WS.

Daemon-only

BrowserBridgeTransport.request() dispatches through an in-process getCurrentBridge() singleton. That means only the process running flatscout start can route requests through the bridge — sibling commands (flatscout scan --source homegate) cannot, even when they see a fresh heartbeat file. Source plugins detect this and fall back to Playwright transparently.

Components

  • protocol.ts — Zod schemas for the wire format (hello, welcome, reject, request, response, error). Single PROTOCOL_VERSION constant; server + extension must agree.
  • secret.ts — 32-byte random shared secret persisted at ${dataDir}/bridge-secret (mode 0600). First file in Flatscout to use this dataDir-secret pattern. Constant-time validation via crypto.timingSafeEqual.
  • server.tsstartBridgeServer({ dataDir, port }) binds a ws WebSocketServer to 127.0.0.1 only (hard-coded; never 0.0.0.0), exposes dispatch(req) to source plugins, tracks one connected extension at a time.
  • heartbeat.ts — writes ${dataDir}/bridge.status.json every ~5s so flatscout bridge status and flatscout doctor can read connection state without opening a second WS client.
  • transport.tsTransport interface + BrowserBridgeTransport adapter (same surface as UndiciTransport / PlaywrightTransport in source plugins).

Used by

  • @flatscout/server — starts the bridge when top.bridge.enabled is true.
  • @flatscout/cliflatscout bridge pair prints the pairing URL + token; flatscout bridge status reads the heartbeat file; flatscout doctor probes the same file.
  • @flatscout/source-homegate — selects BrowserBridgeTransport first when the bridge is connected.
  • @flatscout/source-immoscout24 — paginates IS24 SRP HTML through the bridge and parses window.__INITIAL_STATE__ for full-detail listings; optional PDP enrichment for contact channels.

License

MIT.