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

controlla-unplugin

v1.0.0

Published

Rewrites controlla's proxy-backed control scopes into direct calls at build time

Downloads

318

Readme

controlla-unplugin

Turns controlla's proxy-backed control scopes into direct method calls at build time.

$user.contact.name         // →  $user.a('contact').a('name')
$user.tags[i]              // →  $user.a('tags').a('' + i)
const { name } = $contact  // →  const name = $contact.a('name')
const { name } = getUser() // →  const _c0 = getUser(), name = _c0.a('name')
;({ name } = $contact)     // →  name = $contact.a('name')
({ name }) => name         // →  (_c0) => { const name = _c0.a('name'); return name; }

A control scope is a Proxy, and a proxy trap costs far more than a call — enough to matter on Hermes. With every access rewritten, controlla drops the proxy and hands out plain objects instead.

TypeScript only. Which member accesses walk a control is answered by the compiler, not by a naming convention, so a file the checker can't type is left alone.

Install

npm i -D controlla-unplugin

Vite

import controllaPlugin from 'controlla-unplugin/vite';

export default defineConfig({
  plugins: [controllaPlugin()],
});

Production builds only — dev keeps the proxy, so nothing the rewrite missed can break while you work.

Metro (React Native)

// metro.config.js
module.exports = {
  transformer: {
    babelTransformerPath: require.resolve('controlla-unplugin/metro'),
  },
};

It wraps your existing React Native babel transformer, so nothing else changes.

rolldown / webpack / rspack / esbuild / rollup

import controllaPlugin from 'controlla-unplugin/rolldown';

All five are the same call. Rollup has no define of its own — add @rollup/plugin-replace with __CONTROLLA_PROXYLESS__: 'true'; the others set it for you.

Options

| option | default | | | ---------- | ------------------------------ | ------------------------------------------ | | tsconfig | nearest above the project root | which one the program is built from | | include | /\.[cm]?tsx?$/ | files to rewrite | | exclude | node_modules, .d.ts | files to skip | | warn | true | report accesses the checker couldn't prove |

What it won't rewrite

Warnings, not silent skips:

  • A pattern assigned mid-expressionf(({ name } = $user)). As an expression it answers with the right side; the bindings it would become don't. Give it a statement of its own.
  • An any-typed $ name — nothing to check against.

Everything else is skipped quietly, because the checker proved it isn't a control.

Not using the plugin?

controlla ships both scope implementations, so the proxyless half costs about 70 gzipped bytes in a build that never rewrites anything. To drop those too, define the flag false:

define: {
  __CONTROLLA_PROXYLESS__: 'false';
}

Left undefined it stays the proxy either way — this is only about size.

License

MIT