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

@pinflow/runtime

v0.6.0

Published

Browser-side runtime context capture for PinFlow

Readme

@pinflow/runtime

Browser-side context capture engine for PinFlow's current compatibility layer.

@pinflow/runtime runs in the browser during development and captures component props, state, and DOM context when a developer clicks an element. It is framework-agnostic at its core — framework-specific behavior is provided by adapters.

Install

npm install @pinflow/runtime

Framework Support

| Framework | Adapter | Capture Strategy | | ------------- | ------------------ | ------------------------------------------------ | | React 18-19 | @pinflow/react | Fiber walking, DevTools hook, BestEffort | | Vue 3 | @pinflow/vue | VNode inspection, Composition + Options API | | Next.js 15-16 | @pinflow/next | React adapter + withPinFlow() config wrapper | | Nuxt 3+ | @pinflow/nuxt | Vue adapter + auto-configured Nuxt module |

For most projects you will install a framework adapter rather than @pinflow/runtime directly. The adapter declares @pinflow/runtime as a peer dependency and handles initialization.

RuntimeManager

RuntimeManager is a singleton that manages the active adapter and provides the capture API to the overlay and other internal consumers.

import { RuntimeManager } from '@pinflow/runtime';

const runtime = RuntimeManager.getInstance();
await runtime.initialize({
  adapter: myAdapter,
  phase: 1,
  debug: false,
  redactPII: true,
  blockSelectors: [],
});

Options

| Option | Type | Default | Description | | ---------------- | -------------------------- | ------------- | ----------------------------------------------------------------------------------------------------------- | | adapter | FrameworkAdapter | NoopAdapter | Framework adapter for context capture | | phase | 1 \| 2 | 1 | Feature phase gate. Phase 1: props and state capture. Phase 2: event flow and performance metrics (future). | | debug | boolean | false | Enable debug logging | | redactPII | boolean | true | Redact sensitive values (emails, tokens) in captured data | | blockSelectors | string[] | [] | CSS selectors for elements to skip during capture | | serialization | SerializationConstraints | undefined | Serialization constraints for captured props and state (see below) |

initialize() is safe to call multiple times — subsequent calls with the same configuration are no-ops.

Serialization Constraints

The runtime serializes component props and state with bounded constraints to prevent excessive payload sizes. All fields are optional — defaults are applied by the serializer.

| Option | Default | Description | | ----------------- | ------------------------ | -------------------------------------------------------- | | maxDepth | 6 (props), 4 (state) | Maximum object traversal depth | | maxArrayLength | 20 | Maximum array elements before truncation | | maxStringLength | 2048 | Maximum string length before truncation | | maxProperties | 50 | Maximum properties per object | | maxTotalBytes | 262144 (256 KB) | Approximate byte budget for the entire serialized output |

When a limit is exceeded, the serializer inserts human-readable sentinels ([Max Depth Exceeded], [Truncated: size limit]) and truncation metadata ({ __truncated: true, originalLength: N }) so agents can see what was omitted.

These constraints are configurable per-project via the serialization option on RuntimeOptions, which all framework adapter plugins expose through their runtime namespace.

FrameworkAdapter Interface

Adapters implement the FrameworkAdapter interface to bridge the runtime to a specific framework's internal component model.

interface FrameworkAdapter {
  readonly name: string;
  readonly version?: string;
  getComponentInstance(element: HTMLElement): Nullable<unknown>;
  captureProps(component: unknown): Nullable<Record<string, unknown>>;
  captureState(component: unknown): Nullable<Record<string, unknown>>;
  getComponentName?(component: unknown): Nullable<string>;
  getComponentTree?(component: unknown): Nullable<ComponentTreeNode>;
  getSerializationHints?(): SerializationHints;
}

Serialization Hints

Adapters can implement getSerializationHints() to declare which object keys are framework internals that should be skipped during serialization. This prevents framework plumbing (e.g., React Fiber trees, Vue reactivity markers) from consuming the byte budget.

interface SerializationHints {
  skipKeys?: Set<string>; // Exact keys to omit (e.g., '_owner')
  skipKeyPrefixes?: string[]; // Prefixes to omit (e.g., '__react' catches '__reactFiber$xyz')
}

The React adapter skips _owner, _store, and all __react* keys. The Vue adapter skips __v_* reactivity internals. The NoopAdapter returns no hints — all keys are serialized.

See the Custom Adapters Guide for the full interface, a worked example, and integration instructions.

Links

Part of PinFlow, built on the original PinFlow foundation.

License

MIT