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/transform

v0.6.0

Published

AST injection of stable element IDs and bundler plugins for PinFlow

Readme

@pinflow/transform

AST injection of stable element IDs and bundler plugins for PinFlow.

Install

npm install -D @pinflow/transform

Note: You probably want a framework adapter instead (@pinflow/react, @pinflow/vue, @pinflow/next, @pinflow/nuxt). Those packages wrap this one and handle framework-specific wiring automatically.

Bundler Support

| Bundler | Plugin | Parser | | --------- | -------------------------------------- | ------------------------ | | Vite 5-7 | @pinflow/transform/plugins/vite | Acorn (JS/JSX) or VueSFC | | Webpack 5 | @pinflow/transform/plugins/webpack | Babel (TS/JSX) or VueSFC | | Turbopack | Self-initializing loader | Babel (TS/JSX) |

Configuration

Shared Options — Relay

These options apply to the relay field across all bundler plugins.

| Option | Type | Default | Description | | ----------- | --------- | ----------------- | -------------------------------------------------------- | | autoStart | boolean | true | Auto-start the relay daemon if not running | | port | number | 0 (dynamic) | Relay server port (only used when starting) | | host | string | '127.0.0.1' | Relay server host (only used when starting) | | bodyLimit | number | 10485760 (10MB) | Max request body size in bytes (only used when starting) |

Shared Options — Overlay

These options apply when overlay is set to an object instead of a boolean.

| Option | Type | Default | Description | | ------------- | --------------------------- | ------------- | ------------------------------------ | | initialMode | 'collapsed' \| 'expanded' | 'collapsed' | Initial display mode for the overlay | | debug | boolean | false | Enable debug logging in the overlay |


Vite Plugin

import { pinflow } from '@pinflow/transform/plugins/vite';

pinflow({
  include: /\.(jsx|tsx|vue)$/i,
  exclude: /node_modules|\.test\.|\.spec\./i,
  debug: false,
  relay: { autoStart: true, port: 0, host: '127.0.0.1', bodyLimit: 10485760 },
  overlay: true,
  rootDir: undefined, // Override root directory for .pinflow/ artifacts
});

| Option | Type | Default | Description | | --------- | --------------------------------- | ------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | | include | RegExp | /\.(jsx\|tsx\|vue)$/i | File pattern to include | | exclude | RegExp | /node_modules\|\.test\.\|\.spec\./i | File pattern to exclude | | debug | boolean | false | Enable debug logging | | relay | RelayPluginOptions | See shared | Relay server config | | overlay | boolean \| OverlayPluginOptions | true | Overlay UI config | | rootDir | string | Vite's config.root | Override root directory for .pinflow/ artifacts. |


Webpack Plugin

import { PinFlowWebpackPlugin } from '@pinflow/transform/plugins/webpack';

new PinFlowWebpackPlugin({
  enabled: true,
  debug: false,
  relay: { autoStart: true, port: 0, host: '127.0.0.1' },
  overlay: true,
});

| Option | Type | Default | Description | | --------- | --------------------------------- | ------------------------------------ | -------------------- | | enabled | boolean | true in dev, false in production | Enable the plugin | | debug | boolean | false | Enable debug logging | | relay | RelayPluginOptions | See shared | Relay server config | | overlay | boolean \| OverlayPluginOptions | true | Overlay UI config |

Webpack Loader Options

The webpack loader is managed internally by PinFlowWebpackPlugin. If you need to configure it directly via @pinflow/transform/webpack-loader:

| Option | Type | Default | Description | | --------- | --------- | ------- | --------------------- | | debug | boolean | false | Enable debug logging | | enabled | boolean | true | Enable transformation |


Turbopack Loader

Turbopack has no plugin system, so the loader is self-initializing — it manages relay lifecycle and overlay injection directly.

// next.config.ts (turbopack)
{
  turbopack: {
    rules: {
      '*.{tsx,jsx}': {
        loaders: [{
          loader: '@pinflow/transform/turbopack-loader',
          options: {
            enabled: true,
            debug: false,
            relay: { autoStart: true, port: 0, host: '127.0.0.1' },
            overlay: false,
            autoInitPath: undefined,
          },
        }],
      },
    },
  },
}

| Option | Type | Default | Description | | -------------- | --------------------------------- | ------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | enabled | boolean | true | Enable transformation | | debug | boolean | false | Enable debug logging | | relay | RelayPluginOptions | See shared | Relay server config | | overlay | boolean \| OverlayPluginOptions | false | Overlay UI config. Defaults to false unlike Vite/Webpack — overlay injection must be handled by the meta-framework wrapper. | | autoInitPath | string | undefined (falls back to @pinflow/next/auto-init) | Absolute filesystem path to the auto-init module. Used in pnpm monorepos where transformed files don't directly depend on the auto-init package. Meta-framework wrappers should resolve this via require.resolve(). |

getInitResult()

import { getInitResult } from '@pinflow/transform/plugins/turbopack';

const result = getInitResult();
// { relayHost: string | undefined, relayPort: number | undefined }

Returns the relay host and port detected during loader initialization. Available after the first file is processed. Used by meta-framework wrappers (e.g., @pinflow/next) to read relay connection info after the loader has initialized.


Subpath Exports

| Subpath | Description | | ---------------------------------------- | ---------------------------------------------- | | @pinflow/transform/plugins/vite | Vite plugin (pinflow) | | @pinflow/transform/plugins/webpack | Webpack plugin (PinFlowWebpackPlugin) | | @pinflow/transform/webpack-loader | Webpack loader path (string, for direct use) | | @pinflow/transform/plugins/turbopack | Turbopack exports (getInitResult) | | @pinflow/transform/turbopack-loader | Turbopack loader path (string, for direct use) |

Links

Part of PinFlow, built on the original PinFlow foundation.

License

MIT