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

@supernathaniel/runtime-browser

v0.3.1

Published

Browser instrumentation (fetch/XHR/PerformanceObserver/interaction/navigation) for @fp runtimes

Readme

@supernathaniel/runtime-browser

浏览器采集层:把浏览器运行时行为变成 RuntimeEvent。依赖 runtime-core,不含任何 React 知识。

提供什么

  • 采集插件createBrowserPlugins(flags) 一键全开,或按需单建):
    • createNetworkPlugin:fetch / XHR 补丁,产出 network:start / network:end。 支持 URL 分类(NetworkPluginOptions,string 子串或 RegExp 匹配):
      • ignoreUrls:命中即完全不采集(不发事件、不占 trace 在途)——HMR/sockjs 等开发期噪声;
      • streamingUrls:命中照常采集且事件带 streaming: true 标记,但不占 trace 在途名额—— SSE/流式接口/长轮询等长连接,trace 不再被长连接挂到 maxTraceAgeMs 强制截断,靠真实活动静默收尾;
    • createPerformancePlugin:PerformanceObserver(paint / lcp / longtask / resource 等);
    • createInteractionPlugin:点击等交互(只记 tag/class,不记文本);
    • createNavigationPlugin:导航与路由(history 补丁),产出 navigation:* / route:change
  • 生命周期冲刷createLifecycleFlushPlugin——pagehide / 页面隐藏时用 sendSync(sendBeacon / keepalive)冲刷,保住卸载前的最后一批。
  • 信封 sendercreateBrowserSender({ url, meta, ... })——批次包装为 P4 信封(appKey / sessionId / timeOrigin / sdkDiagnostics),默认 gzip(CompressionStream),beacon 兜底;meta 必填。
  • 远端采样配置fetchSamplingConfig()——拉取 perfmgmt 下发的采样策略,失败保留静态配置。
  • 基础设施createPerformanceClock()detectBrowserCapabilities()sanitizeUrl()

红线

  • 隐私:URL 一律经 sanitizeUrl 剥除 query/hash;不采集 header / body / 表单值 / 文本内容;
  • 降级:每个浏览器接缝(EventTarget / fetch / XHR / PerformanceObserver / history / window)都可注入,能力缺失 = 不安装该插件,永不向宿主抛异常;
  • 所有全局补丁必须在 destroy() 中恢复。

谁依赖它

sdk(门面组装)。宿主应用不直接使用本包。